]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/h264dec: update exported AVOptions in the user-facing context
authorJames Almer <jamrial@gmail.com>
Sat, 10 Apr 2021 19:10:11 +0000 (16:10 -0300)
committerJames Almer <jamrial@gmail.com>
Wed, 14 Apr 2021 23:07:52 +0000 (20:07 -0300)
Based on a patch by Hendrik Leppkes.

Fixes ticket #9176.

Signed-off-by: James Almer <jamrial@gmail.com>
libavcodec/h264_slice.c
libavcodec/h264dec.c
libavcodec/h264dec.h

index 62f7a61aed9af051c78ee6202f386c999c1dbd4b..9c2301d7e0e0fe6a66af13e550d71cee17239fc5 100644 (file)
@@ -464,6 +464,18 @@ int ff_h264_update_thread_context(AVCodecContext *dst,
     return err;
 }
 
+int ff_h264_update_thread_context_for_user(AVCodecContext *dst,
+                                           const AVCodecContext *src)
+{
+    H264Context *h = dst->priv_data;
+    const H264Context *h1 = src->priv_data;
+
+    h->is_avc = h1->is_avc;
+    h->nal_length_size = h1->nal_length_size;
+
+    return 0;
+}
+
 static int h264_frame_start(H264Context *h)
 {
     H264Picture *pic;
index 1dd50ead9f24404803cff9ea2c451262188a7596..e5b77abc6a33536aba5fbb382e3fa07a8267f04e 100644 (file)
@@ -1083,6 +1083,7 @@ AVCodec ff_h264_decoder = {
                              FF_CODEC_CAP_ALLOCATE_PROGRESS | FF_CODEC_CAP_INIT_CLEANUP,
     .flush                 = h264_decode_flush,
     .update_thread_context = ONLY_IF_THREADS_ENABLED(ff_h264_update_thread_context),
+    .update_thread_context_for_user = ONLY_IF_THREADS_ENABLED(ff_h264_update_thread_context_for_user),
     .profiles              = NULL_IF_CONFIG_SMALL(ff_h264_profiles),
     .priv_class            = &h264_class,
 };
index b3677cdbb9edc81fc597b7d4a4457fabf98abc64..8954b74795619f8252221d80a507e79f3500c7d2 100644 (file)
@@ -849,6 +849,8 @@ int ff_h264_queue_decode_slice(H264Context *h, const H2645NAL *nal);
 int ff_h264_execute_decode_slices(H264Context *h);
 int ff_h264_update_thread_context(AVCodecContext *dst,
                                   const AVCodecContext *src);
+int ff_h264_update_thread_context_for_user(AVCodecContext *dst,
+                                           const AVCodecContext *src);
 
 void ff_h264_flush_change(H264Context *h);