summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2008-11-11 17:18:46 +0000
committerWim Taymans <wim.taymans@gmail.com>2008-11-11 17:18:46 +0000
commit97e7c6eceea456ece2a12d8444a65e315914af99 (patch)
tree2b3587ea167ced745b40396a216140e22b65baa5
parent7ce8ab7ad4b038aedb40470f1b0cd06b97919101 (diff)
downloadgst-libav-97e7c6eceea456ece2a12d8444a65e315914af99.tar.gz
ext/ffmpeg/gstffmpegmux.c: Copy the codec aspect ratio to the stream, ffmpeg expects them to be the same. Fixes #560305.
Original commit message from CVS: * ext/ffmpeg/gstffmpegmux.c: (gst_ffmpegmux_setcaps): Copy the codec aspect ratio to the stream, ffmpeg expects them to be the same. Fixes #560305.
-rw-r--r--ChangeLog6
-rw-r--r--ext/ffmpeg/gstffmpegmux.c21
2 files changed, 21 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 1c73e89..d9fdeff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-11-11 Wim Taymans <wim.taymans@collabora.co.uk>
+
+ * ext/ffmpeg/gstffmpegmux.c: (gst_ffmpegmux_setcaps):
+ Copy the codec aspect ratio to the stream, ffmpeg expects them to be the
+ same. Fixes #560305.
+
2008-11-10 Sebastian Dröge <sebastian.droege@collabora.co.uk>
* configure.ac:
diff --git a/ext/ffmpeg/gstffmpegmux.c b/ext/ffmpeg/gstffmpegmux.c
index 5db9ef4..dc6e716 100644
--- a/ext/ffmpeg/gstffmpegmux.c
+++ b/ext/ffmpeg/gstffmpegmux.c
@@ -316,13 +316,22 @@ gst_ffmpegmux_setcaps (GstPad * pad, GstCaps * caps)
/* for the format-specific guesses, we'll go to
* our famous codec mapper */
- if (gst_ffmpeg_caps_to_codecid (caps, st->codec) != CODEC_ID_NONE) {
- GST_LOG_OBJECT (pad, "accepted caps %" GST_PTR_FORMAT, caps);
- return TRUE;
- }
+ if (gst_ffmpeg_caps_to_codecid (caps, st->codec) == CODEC_ID_NONE)
+ goto not_accepted;
+
+ /* copy over the aspect ratios, ffmpeg expects the stream aspect to match the
+ * codec aspect. */
+ st->sample_aspect_ratio = st->codec->sample_aspect_ratio;
+
+ GST_LOG_OBJECT (pad, "accepted caps %" GST_PTR_FORMAT, caps);
+ return TRUE;
- GST_LOG_OBJECT (pad, "rejecting caps %" GST_PTR_FORMAT, caps);
- return FALSE;
+ /* ERRORS */
+not_accepted:
+ {
+ GST_LOG_OBJECT (pad, "rejecting caps %" GST_PTR_FORMAT, caps);
+ return FALSE;
+ }
}