[MPlayer-cvslog] r36565 - in trunk: libmpcodecs/ad_ffmpeg.c libmpdemux/demux_audio.c libmpdemux/demux_lavf.c libmpdemux/stheader.h

cehoyos subversion at mplayerhq.hu
Wed Jan 1 23:17:01 CET 2014


Author: cehoyos
Date: Wed Jan  1 23:17:01 2014
New Revision: 36565

Log:
Set audio channel_layout from container when using FFmpeg decoder.

This will be needed for the Atrac 3 Plus decoder.

Modified:
   trunk/libmpcodecs/ad_ffmpeg.c
   trunk/libmpdemux/demux_audio.c
   trunk/libmpdemux/demux_lavf.c
   trunk/libmpdemux/stheader.h

Modified: trunk/libmpcodecs/ad_ffmpeg.c
==============================================================================
--- trunk/libmpcodecs/ad_ffmpeg.c	Wed Jan  1 23:13:47 2014	(r36564)
+++ trunk/libmpcodecs/ad_ffmpeg.c	Wed Jan  1 23:17:01 2014	(r36565)
@@ -126,6 +126,7 @@ static int init(sh_audio_t *sh_audio)
 	lavc_context->block_align = sh_audio->wf->nBlockAlign;
 	lavc_context->bits_per_coded_sample = sh_audio->wf->wBitsPerSample;
     }
+    lavc_context->channel_layout = sh_audio->channel_layout;
     lavc_context->request_channels = audio_output_channels;
     lavc_context->codec_tag = sh_audio->format; //FOURCC
     lavc_context->codec_id = lavc_codec->id; // not sure if required, imho not --A'rpi

Modified: trunk/libmpdemux/demux_audio.c
==============================================================================
--- trunk/libmpdemux/demux_audio.c	Wed Jan  1 23:13:47 2014	(r36564)
+++ trunk/libmpdemux/demux_audio.c	Wed Jan  1 23:17:01 2014	(r36565)
@@ -533,6 +533,8 @@ static int demux_audio_open(demuxer_t* d
       }
       stream_read(s,(char*)(w + 1),w->cbSize);
       l -= w->cbSize;
+      if (w->cbSize >= 22)
+          sh_audio->channel_layout = av_le2ne16(((WAVEFORMATEXTENSIBLE *)w)->dwChannelMask);
       if (w->wFormatTag == 0xfffe && w->cbSize >= 22)
           sh_audio->format = av_le2ne16(((WAVEFORMATEXTENSIBLE *)w)->SubFormat);
     }

Modified: trunk/libmpdemux/demux_lavf.c
==============================================================================
--- trunk/libmpdemux/demux_lavf.c	Wed Jan  1 23:13:47 2014	(r36564)
+++ trunk/libmpdemux/demux_lavf.c	Wed Jan  1 23:17:01 2014	(r36565)
@@ -295,6 +295,7 @@ static void handle_stream(demuxer_t *dem
             codec->codec_tag = mp_codec_id2tag(codec->codec_id, codec->codec_tag, 1);
             wf->wFormatTag= codec->codec_tag;
             wf->nChannels= codec->channels;
+            sh_audio->channel_layout = codec->channel_layout;
             wf->nSamplesPerSec= codec->sample_rate;
             wf->nAvgBytesPerSec= codec->bit_rate/8;
             wf->nBlockAlign= codec->block_align ? codec->block_align : 1;

Modified: trunk/libmpdemux/stheader.h
==============================================================================
--- trunk/libmpdemux/stheader.h	Wed Jan  1 23:13:47 2014	(r36564)
+++ trunk/libmpdemux/stheader.h	Wed Jan  1 23:17:01 2014	(r36565)
@@ -55,6 +55,7 @@ typedef struct sh_audio {
   int samplerate;
   int samplesize;
   int channels;
+  int channel_layout;
   int o_bps; // == samplerate*samplesize*channels   (uncompr. bytes/sec)
   int i_bps; // == bitrate  (compressed bytes/sec)
   // in buffers:


More information about the MPlayer-cvslog mailing list