summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-09-03 12:29:12 +0200
committerwm4 <wm4@nowhere>2020-09-03 12:29:12 +0200
commit2761f37fe48aa5b3aae3c4d4ce611a6ef07db0ae (patch)
treec7013e26187bef150fcb199111ab0f0145e17a6c
parentb9baa1598a72d1144053819a97665161565a4a3b (diff)
downloadmpv-2761f37fe48aa5b3aae3c4d4ce611a6ef07db0ae.tar.bz2
mpv-2761f37fe48aa5b3aae3c4d4ce611a6ef07db0ae.tar.xz
encode: remove early EOF failure handling
I don't see the point of this. Not doing it may defer an error to later. That's OK? For now, it seems better to reduce the encoding internal API. If someone can demonstrate that this is needed, I might reimplement it in a different way.
-rw-r--r--common/encode.h2
-rw-r--r--common/encode_lavc.c25
-rw-r--r--player/audio.c1
-rw-r--r--player/video.c1
4 files changed, 0 insertions, 29 deletions
diff --git a/common/encode.h b/common/encode.h
index 2803cde4de..974651e103 100644
--- a/common/encode.h
+++ b/common/encode.h
@@ -56,8 +56,6 @@ bool encode_lavc_showhelp(struct mp_log *log, struct encode_opts *options);
int encode_lavc_getstatus(struct encode_lavc_context *ctx, char *buf, int bufsize, float relative_position);
void encode_lavc_expect_stream(struct encode_lavc_context *ctx,
enum stream_type type);
-void encode_lavc_stream_eof(struct encode_lavc_context *ctx,
- enum stream_type type);
void encode_lavc_set_metadata(struct encode_lavc_context *ctx,
struct mp_tags *metadata);
bool encode_lavc_didfail(struct encode_lavc_context *ctx); // check if encoding failed
diff --git a/common/encode_lavc.c b/common/encode_lavc.c
index d45cf20f82..410b909f94 100644
--- a/common/encode_lavc.c
+++ b/common/encode_lavc.c
@@ -356,31 +356,6 @@ done:
pthread_mutex_unlock(&ctx->lock);
}
-void encode_lavc_stream_eof(struct encode_lavc_context *ctx,
- enum stream_type type)
-{
- if (!ctx)
- return;
-
- struct encode_priv *p = ctx->priv;
-
- pthread_mutex_lock(&ctx->lock);
-
- enum AVMediaType codec_type = mp_to_av_stream_type(type);
- struct mux_stream *dst = find_mux_stream(ctx, codec_type);
-
- // If we've reached EOF, even though the stream was selected, and we didn't
- // ever initialize it, we have a problem. We could mux some sort of dummy
- // stream (and could fail if actual data arrives later), or we bail out
- // early.
- if (dst && !dst->st) {
- MP_ERR(p, "No data on stream %s.\n", dst->name);
- p->failed = true;
- }
-
- pthread_mutex_unlock(&ctx->lock);
-}
-
// Signal that you are ready to encode (you provide the codec params etc. too).
// This returns a muxing handle which you can use to add encodec packets.
// Can be called only once per stream. info is copied by callee as needed.
diff --git a/player/audio.c b/player/audio.c
index 739122531f..f4175bc901 100644
--- a/player/audio.c
+++ b/player/audio.c
@@ -927,7 +927,6 @@ void fill_audio_out_buffers(struct MPContext *mpctx)
MP_VERBOSE(mpctx, "audio EOF reached\n");
mpctx->audio_status = STATUS_EOF;
mp_wakeup_core(mpctx);
- encode_lavc_stream_eof(mpctx->encode_lavc_ctx, STREAM_AUDIO);
}
}
diff --git a/player/video.c b/player/video.c
index 387a366666..2b8f03630e 100644
--- a/player/video.c
+++ b/player/video.c
@@ -1072,7 +1072,6 @@ void write_video(struct MPContext *mpctx)
if (mpctx->time_frame <= 0 || !has_frame) {
MP_VERBOSE(mpctx, "video EOF reached\n");
mpctx->video_status = STATUS_EOF;
- encode_lavc_stream_eof(mpctx->encode_lavc_ctx, STREAM_VIDEO);
}
}