[FFmpeg-devel] [PATCH 8/8] decklink: Add support for compressed AC-3 output over SDI

Devin Heitmueller dheitmueller at ltnglobal.com
Fri Dec 29 23:06:40 EET 2017


> On Dec 29, 2017, at 3:59 PM, Carl Eugen Hoyos <ceffmpeg at gmail.com> wrote:
> 
> 2017-12-29 19:12 GMT+01:00 Devin Heitmueller <dheitmueller at ltnglobal.com>:
> 
>> +    uint8_t *outbuf = NULL;
> 
>> +    if (st->codecpar->codec_id == AV_CODEC_ID_AC3)
>> +        av_free(outbuf);
> 
> The "if()" should not be necessary, free() and av_free()
> may be called with argument "NULL”.

We don’t want to call av_free() if outbuf points to the original pkt->data field (i.e. if we’re receiving PCM audio).  We only want to free the memory if we allocated new memory to hold the S337 packet.

The concern isn’t the notion of calling av_free() if outbuf is NULL.  It’s about calling av_free() if outbuf points to pkt->data.

In short, I believe the logic here is correct.

Devin


More information about the ffmpeg-devel mailing list