changeset 10592:69feacc1a220 libavcodec

Factorize "s->first_slice = 1" out.
author michael
date Sat, 28 Nov 2009 23:17:46 +0000
parents 8aff2b05e978
children 46cb472ecc1e
files mpeg12.c
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mpeg12.c	Sat Nov 28 23:05:06 2009 +0000
+++ b/mpeg12.c	Sat Nov 28 23:17:46 2009 +0000
@@ -1384,7 +1384,6 @@
 
     s->y_dc_scale = 8;
     s->c_dc_scale = 8;
-    s->first_slice = 1;
     return 0;
 }
 
@@ -1533,7 +1532,6 @@
             s->pict_type= FF_B_TYPE;
         s->current_picture.pict_type= s->pict_type;
         s->current_picture.key_frame= s->pict_type == FF_I_TYPE;
-        s->first_slice= 1;
     }
     s->intra_dc_precision = get_bits(&s->gb, 2);
     s->picture_structure = get_bits(&s->gb, 2);
@@ -2316,6 +2314,7 @@
             if(mpeg1_decode_picture(avctx,
                                     buf_ptr, input_size) < 0)
                 s2->pict_type=0;
+                s2->first_slice = 1;
             last_code= PICTURE_START_CODE;
             }else{
                 av_log(avctx, AV_LOG_ERROR, "ignoring pic after %X\n", last_code);