[FFmpeg-devel] [PATCH] In vc1 decoder, fix decoding when end sequence is present
Baptiste Coudurier
baptiste.coudurier
Wed Mar 2 12:18:25 CET 2011
On 3/2/11 3:02 AM, Kostya wrote:
> On Wed, Mar 02, 2011 at 02:47:41AM -0800, Baptiste Coudurier wrote:
>> ---
>> libavcodec/vc1dec.c | 6 ++++++
>> 1 files changed, 6 insertions(+), 0 deletions(-)
>>
>> diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
>> index ed92d8c..0f003e5 100644
>> --- a/libavcodec/vc1dec.c
>> +++ b/libavcodec/vc1dec.c
>> @@ -3149,6 +3149,7 @@ static int vc1_decode_frame(AVCodecContext *avctx,
>> const uint8_t *buf_start = buf;
>>
>> /* no supplementary picture */
>> + out:
>> if (buf_size == 0) {
>> /* special case for last picture */
>> if (s->low_delay==0 && s->next_picture_ptr) {
>> @@ -3161,6 +3162,11 @@ static int vc1_decode_frame(AVCodecContext *avctx,
>> return 0;
>> }
>>
>> + if (buf_size == 4 && AV_RB32(buf) == VC1_CODE_ENDOFSEQ) {
>> + buf_size = 0;
>> + goto out;
>> + }
>> +
>> /* We need to set current_picture_ptr before reading the header,
>> * otherwise we cannot store anything in there. */
>> if(s->current_picture_ptr==NULL || s->current_picture_ptr->data[0]){
>
> Why not merge those two conditions instead?
Of course, patch updated.
--
Baptiste COUDURIER
Key fingerprint 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer http://www.ffmpeg.org
More information about the ffmpeg-devel
mailing list