[0.11] gst-ffmpeg: ffmpegdec: Reorder audio channels after clipping the audio buffer

Sebastian Dröge slomo at kemper.freedesktop.org
Tue Jan 10 01:46:04 PST 2012


Module: gst-ffmpeg
Branch: 0.11
Commit: 6931afe0bad5e7e048dff852a685c87a39765ef9
URL:    http://cgit.freedesktop.org/gstreamer/gst-ffmpeg/commit/?id=6931afe0bad5e7e048dff852a685c87a39765ef9

Author: Sebastian Dröge <sebastian.droege at collabora.co.uk>
Date:   Tue Jan 10 10:45:42 2012 +0100

ffmpegdec: Reorder audio channels after clipping the audio buffer

---

 ext/ffmpeg/gstffmpegdec.c |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/ext/ffmpeg/gstffmpegdec.c b/ext/ffmpeg/gstffmpegdec.c
index 9088d9f..0c5846e 100644
--- a/ext/ffmpeg/gstffmpegdec.c
+++ b/ext/ffmpeg/gstffmpegdec.c
@@ -2244,17 +2244,6 @@ gst_ffmpegdec_audio_frame (GstFFMpegDec * ffmpegdec,
   if (len >= 0 && have_data > 0) {
     GstAudioFormat fmt;
 
-    /* Reorder channels to the GStreamer channel order */
-    /* Only the width really matters here... and it's stored as depth */
-    fmt =
-        gst_audio_format_build_integer (TRUE, G_BYTE_ORDER,
-        ffmpegdec->format.audio.depth, ffmpegdec->format.audio.depth);
-
-    gst_audio_reorder_channels (odata, have_data, fmt,
-        ffmpegdec->format.audio.channels,
-        ffmpegdec->format.audio.ffmpeg_layout,
-        ffmpegdec->format.audio.gst_layout);
-
     /* Buffer size */
     gst_buffer_unmap (*outbuf, odata, have_data);
 
@@ -2312,6 +2301,17 @@ gst_ffmpegdec_audio_frame (GstFFMpegDec * ffmpegdec,
                 out_duration)))
       goto clipped;
 
+
+    /* Reorder channels to the GStreamer channel order */
+    /* Only the width really matters here... and it's stored as depth */
+    fmt =
+        gst_audio_format_build_integer (TRUE, G_BYTE_ORDER,
+        ffmpegdec->format.audio.depth * 8, ffmpegdec->format.audio.depth * 8);
+
+    gst_audio_buffer_reorder_channels (*outbuf, fmt,
+        ffmpegdec->format.audio.channels,
+        ffmpegdec->format.audio.ffmpeg_layout,
+        ffmpegdec->format.audio.gst_layout);
   } else {
     gst_buffer_unmap (*outbuf, odata, 0);
     gst_buffer_unref (*outbuf);
@@ -3179,7 +3179,7 @@ gst_ffmpegdec_register (GstPlugin * plugin)
       case CODEC_ID_EAC3:
       case CODEC_ID_AC3:
       case CODEC_ID_DTS:
-        rank = GST_RANK_NONE;
+        rank = GST_RANK_PRIMARY;
         break;
       default:
         rank = GST_RANK_MARGINAL;



More information about the gstreamer-commits mailing list