diff options
author | Edward Hervey <edward.hervey@collabora.co.uk> | 2012-09-08 17:03:33 +0200 |
---|---|---|
committer | Edward Hervey <edward.hervey@collabora.co.uk> | 2012-09-08 17:07:12 +0200 |
commit | 0a4c2524fad98d2cc4ec125db78e6cbc1c5c3bef (patch) | |
tree | 9e42eb9403e2c58e6fe8d92f5c50a90d9ffad658 /gst/videoparsers/gstmpeg4videoparse.c | |
parent | 8968628ca263b3260d310f4b28e60a711703d4e1 (diff) | |
download | gstreamer-plugins-bad-0a4c2524fad98d2cc4ec125db78e6cbc1c5c3bef.tar.gz |
mpeg4videoparse: Don't override upstream framerate and PAR
If upstream provided some, there's a good chance they are the ones to use
Diffstat (limited to 'gst/videoparsers/gstmpeg4videoparse.c')
-rw-r--r-- | gst/videoparsers/gstmpeg4videoparse.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gst/videoparsers/gstmpeg4videoparse.c b/gst/videoparsers/gstmpeg4videoparse.c index f55f09ea4..526edc7cb 100644 --- a/gst/videoparsers/gstmpeg4videoparse.c +++ b/gst/videoparsers/gstmpeg4videoparse.c @@ -533,6 +533,7 @@ static void gst_mpeg4vparse_update_src_caps (GstMpeg4VParse * mp4vparse) { GstCaps *caps = NULL; + GstStructure *s = NULL; GST_LOG_OBJECT (mp4vparse, "Updating caps"); @@ -547,6 +548,7 @@ gst_mpeg4vparse_update_src_caps (GstMpeg4VParse * mp4vparse) GstCaps *tmp = gst_caps_copy (caps); gst_caps_unref (caps); caps = tmp; + s = gst_caps_get_structure (caps, 0); } else { caps = gst_caps_new_simple ("video/mpeg", "mpegversion", G_TYPE_INT, 4, NULL); @@ -570,8 +572,9 @@ gst_mpeg4vparse_update_src_caps (GstMpeg4VParse * mp4vparse) "height", G_TYPE_INT, mp4vparse->vol.height, NULL); } - /* perhaps we have a framerate */ - if (mp4vparse->vol.fixed_vop_time_increment != 0) { + /* perhaps we have a framerate */ + if (mp4vparse->vol.fixed_vop_time_increment != 0 && + (!s || !gst_structure_has_field (s, "framerate"))) { gint fps_num = mp4vparse->vol.vop_time_increment_resolution; gint fps_den = mp4vparse->vol.fixed_vop_time_increment; GstClockTime latency = gst_util_uint64_scale (GST_SECOND, fps_den, fps_num); @@ -584,7 +587,8 @@ gst_mpeg4vparse_update_src_caps (GstMpeg4VParse * mp4vparse) } /* or pixel-aspect-ratio */ - if (mp4vparse->vol.par_width > 0 && mp4vparse->vol.par_height > 0) { + if (mp4vparse->vol.par_width > 0 && mp4vparse->vol.par_height > 0 && + (!s || !gst_structure_has_field (s, "pixel-aspect-ratio"))) { gst_caps_set_simple (caps, "pixel-aspect-ratio", GST_TYPE_FRACTION, mp4vparse->vol.par_width, mp4vparse->vol.par_height, NULL); |