Skip to content

Commit

Permalink
avformat/utils: update deprecated AVStream->codec when the context is…
Browse files Browse the repository at this point in the history
… updated

This ensures the AVStream->codec entry is kept in sync when new streams are
discovered mid-playback or changes to the context occur from other sources.

Fixes trac 5678.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c2e13d2)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
  • Loading branch information
Nevcairiel authored and michaelni committed Jun 30, 2016
1 parent 7747300 commit 79af094
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions libavformat/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -1483,6 +1483,15 @@ static int read_frame_internal(AVFormatContext *s, AVPacket *pkt)
if (ret < 0)
return ret;

#if FF_API_LAVF_AVCTX
FF_DISABLE_DEPRECATION_WARNINGS
/* update deprecated public codec context */
ret = avcodec_parameters_to_context(st->codec, st->codecpar);
if (ret < 0)
return ret;
FF_ENABLE_DEPRECATION_WARNINGS
#endif

st->internal->need_context_update = 0;
}

Expand Down

0 comments on commit 79af094

Please sign in to comment.