summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorJan Schmidt <thaytan@mad.scientist.com>2005-11-22 23:33:41 +0000
committerJan Schmidt <thaytan@mad.scientist.com>2005-11-22 23:33:41 +0000
commit1d43798752b8a6849e43a875800f1eb72f3a51d7 (patch)
tree01dd67474f3957c46d54e5e9c6115e547c3f19d9 /ext
parent602e47bf4ab35808224969dffe4b64b81a39da17 (diff)
ext/ffmpeg/gstffmpegcodecmap.c: Whoops - handle input video caps that don't have a framerate
Original commit message from CVS: * ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_caps_to_pixfmt): Whoops - handle input video caps that don't have a framerate
Diffstat (limited to 'ext')
-rw-r--r--ext/ffmpeg/gstffmpegcodecmap.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/ext/ffmpeg/gstffmpegcodecmap.c b/ext/ffmpeg/gstffmpegcodecmap.c
index 4186dba..e75d9a1 100644
--- a/ext/ffmpeg/gstffmpegcodecmap.c
+++ b/ext/ffmpeg/gstffmpegcodecmap.c
@@ -1109,19 +1109,22 @@ gst_ffmpeg_caps_to_pixfmt (const GstCaps * caps,
gst_structure_get_int (structure, "bpp", &context->bits_per_sample);
fps = gst_structure_get_value (structure, "framerate");
- g_return_if_fail (fps != NULL && GST_VALUE_HOLDS_FRACTION (fps));
+ if (fps != NULL && GST_VALUE_HOLDS_FRACTION (fps)) {
- /* somehow these seem mixed up.. */
- context->time_base.den = gst_value_get_fraction_numerator (fps);
- context->time_base.num = gst_value_get_fraction_denominator (fps);
+ /* somehow these seem mixed up.. */
+ context->time_base.den = gst_value_get_fraction_numerator (fps);
+ context->time_base.num = gst_value_get_fraction_denominator (fps);
- GST_DEBUG ("setting framerate %d/%d = %lf",
+ GST_DEBUG ("setting framerate %d/%d = %lf",
context->time_base.den, context->time_base.num,
1. * context->time_base.den / context->time_base.num);
+ }
if (!raw)
return;
+ g_return_if_fail (fps != NULL && GST_VALUE_HOLDS_FRACTION (fps));
+
if (strcmp (gst_structure_get_name (structure), "video/x-raw-yuv") == 0) {
guint32 fourcc;