OLD | NEW |
1 /* | 1 /* |
2 * MPEG-1/2 decoder | 2 * MPEG-1/2 decoder |
3 * Copyright (c) 2000,2001 Fabrice Bellard | 3 * Copyright (c) 2000,2001 Fabrice Bellard |
4 * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at> | 4 * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at> |
5 * | 5 * |
6 * This file is part of FFmpeg. | 6 * This file is part of FFmpeg. |
7 * | 7 * |
8 * FFmpeg is free software; you can redistribute it and/or | 8 * FFmpeg is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Lesser General Public | 9 * modify it under the terms of the GNU Lesser General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 2217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2228 pc->frame_start_found= 0; | 2228 pc->frame_start_found= 0; |
2229 if(pc->frame_start_found<4 && state == EXT_START_CODE) | 2229 if(pc->frame_start_found<4 && state == EXT_START_CODE) |
2230 pc->frame_start_found++; | 2230 pc->frame_start_found++; |
2231 if(pc->frame_start_found == 4 && (state&0xFFFFFF00) == 0x100){ | 2231 if(pc->frame_start_found == 4 && (state&0xFFFFFF00) == 0x100){ |
2232 if(state < SLICE_MIN_START_CODE || state > SLICE_MAX_START_CODE)
{ | 2232 if(state < SLICE_MIN_START_CODE || state > SLICE_MAX_START_CODE)
{ |
2233 pc->frame_start_found=0; | 2233 pc->frame_start_found=0; |
2234 pc->state=-1; | 2234 pc->state=-1; |
2235 return i-3; | 2235 return i-3; |
2236 } | 2236 } |
2237 } | 2237 } |
2238 if(s && state == PICTURE_START_CODE){ | 2238 if(pc->frame_start_found == 0 && s && state == PICTURE_START_CODE){ |
2239 ff_fetch_timestamp(s, i-3, 1); | 2239 ff_fetch_timestamp(s, i-3, 1); |
2240 } | 2240 } |
2241 } | 2241 } |
2242 } | 2242 } |
2243 pc->state= state; | 2243 pc->state= state; |
2244 return END_NOT_FOUND; | 2244 return END_NOT_FOUND; |
2245 } | 2245 } |
2246 | 2246 |
2247 static int decode_chunks(AVCodecContext *avctx, | 2247 static int decode_chunks(AVCodecContext *avctx, |
2248 AVFrame *picture, int *data_size, | 2248 AVFrame *picture, int *data_size, |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2631 mpeg_decode_init, | 2631 mpeg_decode_init, |
2632 NULL, | 2632 NULL, |
2633 mpeg_decode_end, | 2633 mpeg_decode_end, |
2634 mpeg_decode_frame, | 2634 mpeg_decode_frame, |
2635 CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_HWACCEL_VDPAU | CODEC_CAP_DE
LAY, | 2635 CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_HWACCEL_VDPAU | CODEC_CAP_DE
LAY, |
2636 .flush= flush, | 2636 .flush= flush, |
2637 .long_name = NULL_IF_CONFIG_SMALL("MPEG-1 video (VDPAU acceleration)"), | 2637 .long_name = NULL_IF_CONFIG_SMALL("MPEG-1 video (VDPAU acceleration)"), |
2638 }; | 2638 }; |
2639 #endif | 2639 #endif |
2640 | 2640 |
OLD | NEW |