History

cbs_h264: Add hack for pic_timing with no active SPS

If there is exactly one possible SPS but it is not yet active then just assume that it should be the active one.

Mark Thompson committed 8 years ago

Commit 13ca5d31 parent 0e4c1661 file · +16 −0Browse files

Unified · Split

libavcodec/cbs_h264_syntax_template.c+16−0
@@ -560,6 +560,22 @@ static int FUNC(sei_pic_timing)(CodedBitstreamContext *ctx, RWContext *rw, · 559 unmodified lines
560560 int err;
561561
562562 sps = h264->active_sps;
563+ if (!sps) {
564+ // If there is exactly one possible SPS but it is not yet active
565+ // then just assume that it should be the active one.
566+ int i, k = -1;
567+ for (i = 0; i < H264_MAX_SPS_COUNT; i++) {
568+ if (h264->sps[i]) {
569+ if (k >= 0) {
570+ k = -1;
571+ break;
572+ }
573+ k = i;
574+ }
575+ }
576+ if (k >= 0)
577+ sps = h264->sps[k];
578+ }
563579 if (!sps) {
564580 av_log(ctx->log_ctx, AV_LOG_ERROR,
565581 "No active SPS for pic_timing.\n");

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t