[FFmpeg-devel] [PATCH]Never favour an audio stream with 0 channels in av_find_best_stream

Michael Niedermayer michaelni at gmx.at
Thu Jan 16 00:29:01 CET 2014


On Wed, Jan 15, 2014 at 11:51:17PM +0100, Carl Eugen Hoyos wrote:
> Hi!
> 
> Attached patch fixes ticket #3311 for me.
> 
> Please comment, Carl Eugen

>  utils.c |    2 ++
>  1 file changed, 2 insertions(+)
> 875818f22eb76129898bc5b66ff3d471c1d38900  patchbestaudio.diff
> diff --git a/libavformat/utils.c b/libavformat/utils.c
> index 3f4446d..c530511 100644
> --- a/libavformat/utils.c
> +++ b/libavformat/utils.c
> @@ -3263,6 +3263,8 @@ int av_find_best_stream(AVFormatContext *ic,
>              continue;
>          if (st->disposition & (AV_DISPOSITION_HEARING_IMPAIRED|AV_DISPOSITION_VISUAL_IMPAIRED))
>              continue;
> +        if (type == AVMEDIA_TYPE_AUDIO && !avctx->channels)
> +            continue;
>          if (decoder_ret) {
>              decoder = find_decoder(ic, st, st->codec->codec_id);
>              if (!decoder) {

should be ok

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Into a blind darkness they enter who follow after the Ignorance,
they as if into a greater darkness enter who devote themselves
to the Knowledge alone. -- Isha Upanishad
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140116/b12cb04b/attachment.asc>


More information about the ffmpeg-devel mailing list