aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2016-06-30 14:10:42 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2016-06-30 17:58:11 +0200
commit79af094b9304676a2bd83a5172fac97f0d964c1a (patch)
tree878f71719a3022a830bb41e6be7aa94d5ba303fa /libavformat/utils.c
parent77473002898f1dce18761c8a9bca48a8fe888d2e (diff)
downloadffmpeg-79af094b9304676a2bd83a5172fac97f0d964c1a.tar.gz
avformat/utils: update deprecated AVStream->codec when the context is 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 c2e13d2ecd388bab28e743c34ed146c5ed213fc9) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 6f343f228c..d2a709c9a4 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -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;
}