Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Thompson <sw@jkqxz.net>2018-02-22 01:05:15 +0300
committerMark Thompson <sw@jkqxz.net>2018-02-22 01:05:15 +0300
commitb656fa710a34ec7c3b192c38344a2c470ff2eaf5 (patch)
tree5cb21478969a219a21f297680c74010ef97822e8 /libavcodec/cbs_h264_syntax_template.c
parentaf3727e2399df83b57892c22011e4dd748516897 (diff)
parent13ca5d34ba5c473211daaae0a101123bcaada3e6 (diff)
Merge commit '13ca5d34ba5c473211daaae0a101123bcaada3e6'
* commit '13ca5d34ba5c473211daaae0a101123bcaada3e6': cbs_h264: Add hack for pic_timing with no active SPS Partially fixes #6896 - the sample stream from that ticket now works, but more obscure cases can still fail. Merged-by: Mark Thompson <sw@jkqxz.net>
Diffstat (limited to 'libavcodec/cbs_h264_syntax_template.c')
-rw-r--r--libavcodec/cbs_h264_syntax_template.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/libavcodec/cbs_h264_syntax_template.c b/libavcodec/cbs_h264_syntax_template.c
index 2d60273506..267f35ccb7 100644
--- a/libavcodec/cbs_h264_syntax_template.c
+++ b/libavcodec/cbs_h264_syntax_template.c
@@ -561,6 +561,22 @@ static int FUNC(sei_pic_timing)(CodedBitstreamContext *ctx, RWContext *rw,
sps = h264->active_sps;
if (!sps) {
+ // If there is exactly one possible SPS but it is not yet active
+ // then just assume that it should be the active one.
+ int i, k = -1;
+ for (i = 0; i < H264_MAX_SPS_COUNT; i++) {
+ if (h264->sps[i]) {
+ if (k >= 0) {
+ k = -1;
+ break;
+ }
+ k = i;
+ }
+ }
+ if (k >= 0)
+ sps = h264->sps[k];
+ }
+ if (!sps) {
av_log(ctx->log_ctx, AV_LOG_ERROR,
"No active SPS for pic_timing.\n");
return AVERROR_INVALIDDATA;