ext/ffmpeg/gstffmpegdec.c: Don't blindly assume there is a codec.

Original commit message from CVS:
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_setcaps),
(gst_ffmpegdec_frame):
Don't blindly assume there is a codec.
This commit is contained in:
Wim Taymans 2005-09-19 13:45:38 +00:00
parent 10dea5bfbb
commit f9a174c86e
2 changed files with 13 additions and 0 deletions

View file

@ -1,3 +1,9 @@
2005-09-19 Wim Taymans <wim@fluendo.com>
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_setcaps),
(gst_ffmpegdec_frame):
Don't blindly assume there is a codec.
2005-09-19 Wim Taymans <wim@fluendo.com>
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_caps_to_pixfmt):

View file

@ -459,6 +459,8 @@ gst_ffmpegdec_setcaps (GstPad * pad, GstCaps * caps)
GstStructure *structure;
const GValue *par;
GST_DEBUG ("setcaps called");
/* close old session */
gst_ffmpegdec_close (ffmpegdec);
@ -472,7 +474,9 @@ gst_ffmpegdec_setcaps (GstPad * pad, GstCaps * caps)
/* get size and so */
gst_ffmpeg_caps_with_codecid (oclass->in_plugin->id,
oclass->in_plugin->type, caps, ffmpegdec->context);
if (!ffmpegdec->context->time_base.den) {
GST_DEBUG ("forcing 25/1 framerate");
ffmpegdec->context->time_base.num = 1;
ffmpegdec->context->time_base.den = 25;
}
@ -693,6 +697,9 @@ gst_ffmpegdec_frame (GstFFMpegDec * ffmpegdec,
GstBuffer *outbuf = NULL;
gint have_data = 0, len = 0;
if (ffmpegdec->context->codec == NULL)
return -1;
ffmpegdec->context->frame_number++;
switch (oclass->in_plugin->type) {