Skip to content

Commit 0460b9b

Browse files
committed
Merge commit 'c872d310cd9c605e5f994ad8ac79dc72303c0d29'
* commit 'c872d310cd9c605e5f994ad8ac79dc72303c0d29': avconv: stop accessing AVStream.parser Conflicts: ffmpeg.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
2 parents 15b1b08 + c872d31 commit 0460b9b

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

ffmpeg.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,8 @@ static void ffmpeg_cleanup(int ret)
468468
output_streams[i]->bitstream_filters = NULL;
469469
avcodec_free_frame(&output_streams[i]->filtered_frame);
470470

471+
av_parser_close(output_streams[i]->parser);
472+
471473
av_freep(&output_streams[i]->forced_keyframes);
472474
av_expr_free(output_streams[i]->forced_keyframes_pexpr);
473475
av_freep(&output_streams[i]->avfilter);
@@ -1467,7 +1469,10 @@ static void do_streamcopy(InputStream *ist, OutputStream *ost, const AVPacket *p
14671469
&& ost->st->codec->codec_id != AV_CODEC_ID_MPEG2VIDEO
14681470
&& ost->st->codec->codec_id != AV_CODEC_ID_VC1
14691471
) {
1470-
if (av_parser_change(ist->st->parser, ost->st->codec, &opkt.data, &opkt.size, pkt->data, pkt->size, pkt->flags & AV_PKT_FLAG_KEY)) {
1472+
if (av_parser_change(ost->parser, ost->st->codec,
1473+
&opkt.data, &opkt.size,
1474+
pkt->data, pkt->size,
1475+
pkt->flags & AV_PKT_FLAG_KEY)) {
14711476
opkt.buf = av_buffer_create(opkt.data, opkt.size, av_buffer_default_free, NULL, 0);
14721477
if (!opkt.buf)
14731478
exit_program(1);
@@ -2256,6 +2261,8 @@ static int transcode_init(void)
22562261
av_reduce(&codec->time_base.num, &codec->time_base.den,
22572262
codec->time_base.num, codec->time_base.den, INT_MAX);
22582263

2264+
ost->parser = av_parser_init(codec->codec_id);
2265+
22592266
switch (codec->codec_type) {
22602267
case AVMEDIA_TYPE_AUDIO:
22612268
if (audio_volume != 256) {

ffmpeg.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,8 @@ typedef struct OutputStream {
371371
int copy_prior_start;
372372

373373
int keep_pix_fmt;
374+
375+
AVCodecParserContext *parser;
374376
} OutputStream;
375377

376378
typedef struct OutputFile {

0 commit comments

Comments
 (0)