lavf: convert the generic layer to the new channel layout

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
Anton Khirnov
2019-05-15 09:36:26 +02:00
committed by James Almer
parent c30e22c9fb
commit ac10e3c47c
3 changed files with 35 additions and 3 deletions

View File

@@ -525,7 +525,7 @@ int av_find_best_stream(AVFormatContext *ic, enum AVMediaType type,
continue;
if (wanted_stream_nb >= 0 && real_stream_index != wanted_stream_nb)
continue;
if (type == AVMEDIA_TYPE_AUDIO && !(par->channels && par->sample_rate))
if (type == AVMEDIA_TYPE_AUDIO && !(par->ch_layout.nb_channels && par->sample_rate))
continue;
if (decoder_ret) {
decoder = ff_find_decoder(ic, st, par->codec_id);
@@ -1523,7 +1523,7 @@ static int match_stream_specifier(const AVFormatContext *s, const AVStream *st,
int val;
switch (par->codec_type) {
case AVMEDIA_TYPE_AUDIO:
val = par->sample_rate && par->channels;
val = par->sample_rate && par->ch_layout.nb_channels;
if (par->format == AV_SAMPLE_FMT_NONE)
return 0;
break;