h264: set h->sps if none is set yet
This commit is contained in:
parent
a8f55b41a0
commit
0363fc2bb5
|
@ -417,6 +417,20 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
|||
ret = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* activate the first SPS to determine basic stream information */
|
||||
if (!h->ps.sps) {
|
||||
int i;
|
||||
for (i = 0; i < FF_ARRAY_ELEMS(h->ps.pps_list) && !h->ps.sps; i++) {
|
||||
if (h->ps.pps_list[i]) {
|
||||
h->ps.pps_ref = av_buffer_ref(h->ps.pps_list[i]);
|
||||
if (!h->ps.pps_list)
|
||||
return AVERROR(ENOMEM);
|
||||
h->ps.pps = (const PPS*)h->ps.pps_ref->data;
|
||||
h->ps.sps = h->ps.pps->sps;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (h->ps.sps) {
|
||||
|
|
Loading…
Reference in New Issue