diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2012-01-10 10:45:42 +0100 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2012-01-10 10:45:42 +0100 |
commit | 6931afe0bad5e7e048dff852a685c87a39765ef9 (patch) | |
tree | 457291e137a6b7a1b8337bf7606317ff1daf7a7b | |
parent | 3d6c803917d133d3839909c60c6e372743a1381d (diff) |
ffmpegdec: Reorder audio channels after clipping the audio buffer
-rw-r--r-- | 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; |