Commit f9a174c8 authored by Wim Taymans's avatar Wim Taymans

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.
parent 10dea5bf
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):
......
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment