Commit 02d8abf0 authored by 赵宇龙's avatar 赵宇龙 Committed by Michael Niedermayer

h264_mp4toannexb: fix pps offfset fault when there are more than one sps in avcc

the pps offset is used to locate pps in the spspps_buf; however, the
current calc method is wrong because it is the offset of the original
avctx->extradata;
when there is only one sps in the avcc; the value is correct by
coincidence, however, it will
fail in avcc with multi sps
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 6b32d0d86b6bec2b5cb565d6ab4556f8cd66214a)
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 9579550b
...@@ -122,7 +122,7 @@ pps: ...@@ -122,7 +122,7 @@ pps:
if (!unit_nb && !sps_done++) { if (!unit_nb && !sps_done++) {
unit_nb = *extradata++; /* number of pps unit(s) */ unit_nb = *extradata++; /* number of pps unit(s) */
if (unit_nb) { if (unit_nb) {
ctx->pps_offset = (extradata - 1) - (avctx->extradata + 4); ctx->pps_offset = total_size;
pps_seen = 1; pps_seen = 1;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment