[FFmpeg-devel] [PATCH] avformat: close parser if codec changed

Andreas Cadhalpun andreas.cadhalpun at googlemail.com
Sat Oct 22 02:16:00 EEST 2016

On 22.10.2016 00:18, Michael Niedermayer wrote:
> On Mon, Oct 17, 2016 at 08:49:23PM +0200, Andreas Cadhalpun wrote:
>> The parser depends on the codec and thus must not be used with a different one.
>> If it is, the 'avctx->codec_id == s->parser->codec_ids[0] ...' assert in
>> av_parser_parse2 gets triggered.
>> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
>> ---
>>  libavformat/utils.c | 12 ++++++++++++
>>  1 file changed, 12 insertions(+)
> This changes the audio output from
> http://samples.ffmpeg.org/MPEG2/vid_0x80.ts
> is that intended ?

Nice catch: it shouldn't change, of course.

While processing that sample only the codec_tag gets changed, which is no reason to
close the parser. That is only necessary, when the codec_id changes.

Fixed patch is attached.

Best regards,

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-avformat-close-parser-if-codec-changed.patch
Type: text/x-diff
Size: 1798 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20161022/d504f410/attachment.patch>

More information about the ffmpeg-devel mailing list