Fixes ticket #2220.
Fixes ticket #4324.
... | ... |
@@ -1203,7 +1203,7 @@ static void mpegts_write_pes(AVFormatContext *s, AVStream *st, |
1203 | 1203 |
|
1204 | 1204 |
int ff_check_h264_startcode(AVFormatContext *s, const AVStream *st, const AVPacket *pkt) |
1205 | 1205 |
{ |
1206 |
- if (pkt->size < 5 || AV_RB32(pkt->data) != 0x0000001) { |
|
1206 |
+ if (pkt->size < 5 || AV_RB32(pkt->data) != 0x0000001 && AV_RB24(pkt->data) != 0x000001) { |
|
1207 | 1207 |
if (!st->nb_frames) { |
1208 | 1208 |
av_log(s, AV_LOG_ERROR, "H.264 bitstream malformed, " |
1209 | 1209 |
"no startcode found, use the video bitstream filter 'h264_mp4toannexb' to fix it " |