From 395ebbdf4b047ead4591b0806dd838c06b3da652 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Sat, 2 Apr 2005 10:01:20 +0000 Subject: [PATCH] ext/ffmpeg/gstffmpegdec.c: Fix breakage of testsuite by adding keyframe syncing; changed to sync only for some stream... Original commit message from CVS: * ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_open), (gst_ffmpegdec_handle_event): Fix breakage of testsuite by adding keyframe syncing; changed to sync only for some streamtypes (MPEG-2/-4, for now). * ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_add): Add tags. --- ChangeLog | 9 +++++++++ ext/ffmpeg/gstffmpegdec.c | 7 +++++-- ext/ffmpeg/gstffmpegdemux.c | 11 +++++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0562bbb..e699356 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2005-04-02 Ronald S. Bultje + + * ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_open), + (gst_ffmpegdec_handle_event): + Fix breakage of testsuite by adding keyframe syncing; changed + to sync only for some streamtypes (MPEG-2/-4, for now). + * ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_add): + Add tags. + 2005-04-01 Ronald S. Bultje * ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_init), diff --git a/ext/ffmpeg/gstffmpegdec.c b/ext/ffmpeg/gstffmpegdec.c index b51b8ab..e33d32c 100644 --- a/ext/ffmpeg/gstffmpegdec.c +++ b/ext/ffmpeg/gstffmpegdec.c @@ -415,7 +415,6 @@ gst_ffmpegdec_open (GstFFMpegDec *ffmpegdec) default: break; } - ffmpegdec->waiting_for_key = TRUE; ffmpegdec->next_ts = 0; return TRUE; @@ -819,7 +818,11 @@ gst_ffmpegdec_handle_event (GstFFMpegDec * ffmpegdec, GstEvent * event) } if (ffmpegdec->opened) { avcodec_flush_buffers (ffmpegdec->context); - ffmpegdec->waiting_for_key = TRUE; + + if (ffmpegdec->context->codec_id == CODEC_ID_MPEG2VIDEO || + ffmpegdec->context->codec_id == CODEC_ID_MPEG4) { + ffmpegdec->waiting_for_key = TRUE; + } } /* fall-through */ } diff --git a/ext/ffmpeg/gstffmpegdemux.c b/ext/ffmpeg/gstffmpegdemux.c index 4705b55..00828bf 100644 --- a/ext/ffmpeg/gstffmpegdemux.c +++ b/ext/ffmpeg/gstffmpegdemux.c @@ -473,6 +473,7 @@ gst_ffmpegdemux_add (GstFFMpegDemux * demux, AVStream * stream) GstCaps *caps; gint num; gchar *padname; + const gchar *codec; switch (stream->codec.codec_type) { case CODEC_TYPE_VIDEO: @@ -513,6 +514,16 @@ gst_ffmpegdemux_add (GstFFMpegDemux * demux, AVStream * stream) gst_element_add_pad (GST_ELEMENT (demux), pad); + /* metadata */ + if ((codec = gst_ffmpeg_get_codecid_longname (stream->codec.codec_id))) { + GstTagList *list = gst_tag_list_new (); + + gst_tag_list_add (list, GST_TAG_MERGE_REPLACE, + (stream->codec.codec_type == CODEC_TYPE_VIDEO) ? + GST_TAG_VIDEO_CODEC : GST_TAG_AUDIO_CODEC, codec, NULL); + gst_element_found_tags_for_pad (GST_ELEMENT (demux), pad, 0, list); + } + return TRUE; } -- 2.7.4