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.
This commit is contained in:
Ronald S. Bultje 2005-04-02 10:01:20 +00:00
parent e65e6b8042
commit 395ebbdf4b
3 changed files with 25 additions and 2 deletions

View file

@ -1,3 +1,12 @@
2005-04-02 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* 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 <rbultje@ronald.bitfreak.net>
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_init),

View file

@ -415,7 +415,6 @@ gst_ffmpegdec_open (GstFFMpegDec *ffmpegdec)
default:
break;
}
ffmpegdec->waiting_for_key = TRUE;
ffmpegdec->next_ts = 0;
return TRUE;
@ -819,8 +818,12 @@ gst_ffmpegdec_handle_event (GstFFMpegDec * ffmpegdec, GstEvent * event)
}
if (ffmpegdec->opened) {
avcodec_flush_buffers (ffmpegdec->context);
if (ffmpegdec->context->codec_id == CODEC_ID_MPEG2VIDEO ||
ffmpegdec->context->codec_id == CODEC_ID_MPEG4) {
ffmpegdec->waiting_for_key = TRUE;
}
}
/* fall-through */
}
default:

View file

@ -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;
}