Unified · Split
| @@ -87,11 +87,7 @@ static int h264_mp4toannexb_filter(AVBitStreamFilterContext *bsfc, · 86 unmodified lines | |||
| 87 | /* retrieve sps and pps unit(s) */ | 87 | /* retrieve sps and pps unit(s) */ |
| 88 | unit_nb = *extradata++ & 0x1f; /* number of sps unit(s) */ | 88 | unit_nb = *extradata++ & 0x1f; /* number of sps unit(s) */ |
| 89 | if (!unit_nb) { | 89 | if (!unit_nb) { |
| 90 | unit_nb = *extradata++; /* number of pps unit(s) */ | 90 | goto pps; |
| 91 | sps_done++; | ||
| 92 | |||
| 93 | if (unit_nb) | ||
| 94 | pps_seen = 1; | ||
| 95 | } else { | 91 | } else { |
| 96 | sps_seen = 1; | 92 | sps_seen = 1; |
| 97 | } | 93 | } |
| @@ -115,7 +111,7 @@ static int h264_mp4toannexb_filter(AVBitStreamFilterContext *bsfc, · 17 unmodified lines | |||
| 115 | memcpy(out+total_size-unit_size-4, nalu_header, 4); | 111 | memcpy(out+total_size-unit_size-4, nalu_header, 4); |
| 116 | memcpy(out+total_size-unit_size, extradata+2, unit_size); | 112 | memcpy(out+total_size-unit_size, extradata+2, unit_size); |
| 117 | extradata += 2+unit_size; | 113 | extradata += 2+unit_size; |
| 118 | 114 | pps: | |
| 119 | if (!unit_nb && !sps_done++) { | 115 | if (!unit_nb && !sps_done++) { |
| 120 | unit_nb = *extradata++; /* number of pps unit(s) */ | 116 | unit_nb = *extradata++; /* number of pps unit(s) */ |
| 121 | if (unit_nb) | 117 | if (unit_nb) |