Mercurial > libavcodec.hg
comparison mpeg12.c @ 10591:8aff2b05e978 libavcodec
Also check the location of the picture start code and picture coding
extension a little.
author | michael |
---|---|
date | Sat, 28 Nov 2009 23:05:06 +0000 |
parents | 0c6e62729784 |
children | 69feacc1a220 |
comparison
equal
deleted
inserted
replaced
10590:0c6e62729784 | 10591:8aff2b05e978 |
---|---|
2304 av_log(avctx, AV_LOG_ERROR, "ignoring SEQ_START_CODE after %X\n", last_code); | 2304 av_log(avctx, AV_LOG_ERROR, "ignoring SEQ_START_CODE after %X\n", last_code); |
2305 } | 2305 } |
2306 break; | 2306 break; |
2307 | 2307 |
2308 case PICTURE_START_CODE: | 2308 case PICTURE_START_CODE: |
2309 if(last_code == 0 || last_code == SLICE_MIN_START_CODE){ | |
2309 if(mpeg_decode_postinit(avctx) < 0){ | 2310 if(mpeg_decode_postinit(avctx) < 0){ |
2310 av_log(avctx, AV_LOG_ERROR, "mpeg_decode_postinit() failure\n"); | 2311 av_log(avctx, AV_LOG_ERROR, "mpeg_decode_postinit() failure\n"); |
2311 return -1; | 2312 return -1; |
2312 } | 2313 } |
2313 | 2314 |
2314 /* we have a complete image: we try to decompress it */ | 2315 /* we have a complete image: we try to decompress it */ |
2315 if(mpeg1_decode_picture(avctx, | 2316 if(mpeg1_decode_picture(avctx, |
2316 buf_ptr, input_size) < 0) | 2317 buf_ptr, input_size) < 0) |
2317 s2->pict_type=0; | 2318 s2->pict_type=0; |
2318 last_code= PICTURE_START_CODE; | 2319 last_code= PICTURE_START_CODE; |
2320 }else{ | |
2321 av_log(avctx, AV_LOG_ERROR, "ignoring pic after %X\n", last_code); | |
2322 } | |
2319 break; | 2323 break; |
2320 case EXT_START_CODE: | 2324 case EXT_START_CODE: |
2321 init_get_bits(&s2->gb, buf_ptr, input_size*8); | 2325 init_get_bits(&s2->gb, buf_ptr, input_size*8); |
2322 | 2326 |
2323 switch(get_bits(&s2->gb, 4)) { | 2327 switch(get_bits(&s2->gb, 4)) { |
2336 break; | 2340 break; |
2337 case 0x7: | 2341 case 0x7: |
2338 mpeg_decode_picture_display_extension(s); | 2342 mpeg_decode_picture_display_extension(s); |
2339 break; | 2343 break; |
2340 case 0x8: | 2344 case 0x8: |
2345 if(last_code == PICTURE_START_CODE){ | |
2341 mpeg_decode_picture_coding_extension(s); | 2346 mpeg_decode_picture_coding_extension(s); |
2342 last_code= PICTURE_START_CODE; | 2347 }else{ |
2348 av_log(avctx, AV_LOG_ERROR, "ignoring pic cod ext after %X\n", last_code); | |
2349 } | |
2343 break; | 2350 break; |
2344 } | 2351 } |
2345 break; | 2352 break; |
2346 case USER_START_CODE: | 2353 case USER_START_CODE: |
2347 mpeg_decode_user_data(avctx, | 2354 mpeg_decode_user_data(avctx, |