diff options
author | wm4 <wm4@nowhere> | 2013-04-06 22:43:12 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-05-12 21:24:55 +0200 |
commit | 4b5cee4617d0decbf93d06df4f45097fd7e00105 (patch) | |
tree | b6d293e86d83ab5c3efd99153aa7a7a134d2937f /core/mplayer.c | |
parent | 586b75ad0840e154835ae67c7720b71bd36f8cc9 (diff) | |
download | mpv-4b5cee4617d0decbf93d06df4f45097fd7e00105.tar.bz2 mpv-4b5cee4617d0decbf93d06df4f45097fd7e00105.tar.xz |
core: use channel map on demuxer level too
This helps passing the channel layout correctly from decoder to audio
filter chain. (Because that part "reuses" the demuxer level codec
parameters, which is very disgusting.)
Note that ffmpeg stuff already passed the channel layout via
mp_copy_lav_codec_headers(). So other than easier dealing with the
demuxer/decoder parameters mess, there's no real advantage to doing
this.
Make the --channels option accept a channel map. Since simple numbers
map to standard layouts with the given number of channels, this is
downwards compatible. Likewise for demux_rawaudio.
Diffstat (limited to 'core/mplayer.c')
-rw-r--r-- | core/mplayer.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/core/mplayer.c b/core/mplayer.c index 3f7df8ef36..665216921e 100644 --- a/core/mplayer.c +++ b/core/mplayer.c @@ -324,7 +324,7 @@ static void print_file_properties(struct MPContext *mpctx, const char *filename) mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_AUDIO_RATE=%d\n", mpctx->sh_audio->samplerate); mp_msg(MSGT_IDENTIFY, MSGL_INFO, - "ID_AUDIO_NCH=%d\n", mpctx->sh_audio->channels); + "ID_AUDIO_NCH=%d\n", mpctx->sh_audio->channels.num); start_pts = ds_get_next_pts(mpctx->sh_audio->ds); } if (video_start_pts != MP_NOPTS_VALUE) { @@ -1563,8 +1563,11 @@ void reinit_audio_chain(struct MPContext *mpctx) mpctx->ao->samplerate = opts->force_srate; mpctx->ao->format = opts->audio_output_format; // Automatic downmix - if (opts->audio_output_channels == 2 && mpctx->sh_audio->channels != 2) + if (mp_chmap_is_stereo(&opts->audio_output_channels) && + !mp_chmap_is_stereo(&mpctx->sh_audio->channels)) + { mp_chmap_from_channels(&mpctx->ao->channels, 2); + } } ao = mpctx->ao; |