[FFmpeg-cvslog] cbs_h264: Fix SPS used for pic_timing timestamp

Mark Thompson git at videolan.org
Tue Oct 23 01:20:19 EEST 2018


ffmpeg | branch: master | Mark Thompson <sw at jkqxz.net> | Tue Oct 16 22:01:27 2018 +0100| [e5fda1ff289692ffb538e04abb66a9b550750596] | committer: Mark Thompson

cbs_h264: Fix SPS used for pic_timing timestamp

It should be the same as the one used for the rest of the pic_timing
structure.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e5fda1ff289692ffb538e04abb66a9b550750596
---

 libavcodec/cbs_h264_syntax_template.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/libavcodec/cbs_h264_syntax_template.c b/libavcodec/cbs_h264_syntax_template.c
index 1a9fb9cfeb..7d0ce5918a 100644
--- a/libavcodec/cbs_h264_syntax_template.c
+++ b/libavcodec/cbs_h264_syntax_template.c
@@ -551,10 +551,9 @@ static int FUNC(sei_buffering_period)(CodedBitstreamContext *ctx, RWContext *rw,
 }
 
 static int FUNC(sei_pic_timestamp)(CodedBitstreamContext *ctx, RWContext *rw,
-                                   H264RawSEIPicTimestamp *current)
+                                   H264RawSEIPicTimestamp *current,
+                                   const H264RawSPS *sps)
 {
-    CodedBitstreamH264Context *h264 = ctx->priv_data;
-    const H264RawSPS *sps;
     uint8_t time_offset_length;
     int err;
 
@@ -583,13 +582,6 @@ static int FUNC(sei_pic_timestamp)(CodedBitstreamContext *ctx, RWContext *rw,
         }
     }
 
-    sps = h264->active_sps;
-    if (!sps) {
-        av_log(ctx->log_ctx, AV_LOG_ERROR,
-               "No active SPS for pic_timestamp.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
     if (sps->vui.nal_hrd_parameters_present_flag)
         time_offset_length = sps->vui.nal_hrd_parameters.time_offset_length;
     else if (sps->vui.vcl_hrd_parameters_present_flag)
@@ -669,7 +661,8 @@ static int FUNC(sei_pic_timing)(CodedBitstreamContext *ctx, RWContext *rw,
         for (i = 0; i < num_clock_ts[current->pic_struct]; i++) {
             flags(clock_timestamp_flag[i], 1, i);
             if (current->clock_timestamp_flag[i])
-                CHECK(FUNC(sei_pic_timestamp)(ctx, rw, &current->timestamp[i]));
+                CHECK(FUNC(sei_pic_timestamp)(ctx, rw,
+                                              &current->timestamp[i], sps));
         }
     }
 



More information about the ffmpeg-cvslog mailing list