[FFmpeg-devel] [PATCH] avcodec: wrapped avframe for audio

Paul B Mahol onemda at gmail.com
Mon Aug 15 15:01:16 EEST 2016


On 8/15/16, Nicolas George <george at nsup.org> wrote:
> L'octidi 28 thermidor, an CCXXIV, Paul B Mahol a écrit :
>> Hi,
>>
>> patch attached.
>
>> From c8f147cff360a4b187e2cf7ef1d848e162a156a8 Mon Sep 17 00:00:00 2001
>> From: Paul B Mahol <onemda at gmail.com>
>> Date: Sun, 14 Aug 2016 22:48:35 +0200
>> Subject: [PATCH] avcodec: wrapped avframe for audio
>>
>> ---
>>  libavcodec/utils.c    | 5 +++--
>>  libavformat/nullenc.c | 2 +-
>>  2 files changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/libavcodec/utils.c b/libavcodec/utils.c
>> index 783f62c..8280dd8 100644
>> --- a/libavcodec/utils.c
>> +++ b/libavcodec/utils.c
>> @@ -1337,7 +1337,8 @@ int attribute_align_arg avcodec_open2(AVCodecContext
>> *avctx, const AVCodec *code
>>          avctx->codec_id   = codec->id;
>>      }
>>      if (avctx->codec_id != codec->id || (avctx->codec_type !=
>> codec->type
>> -                                         && avctx->codec_type !=
>> AVMEDIA_TYPE_ATTACHMENT)) {
>> +                                         && (avctx->codec_type !=
>> AVMEDIA_TYPE_ATTACHMENT) &&
>> +                                            (avctx->codec_id !=
>> AV_CODEC_ID_WRAPPED_AVFRAME))) {
>
> Can you explain (in the commit message or as a comment maybe) why this
> change is necessary for audio but not for video?
>
> Also, the parentheses are unnecessary and make reading the condition
> harder.
> I suggest, since the lines are changed anyway, to move the first && to the
> end of the previous line:

Because wrapper_avframe encoder is marked as video only.
And we don't have concept of encoders that can do both audio and video.


More information about the ffmpeg-devel mailing list