Merge commit 'b869eea7ea8f5d8331fcd6355f848bb6a6e06b14'
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 15 Aug 2014 00:27:03 +0000 (02:27 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 15 Aug 2014 00:28:49 +0000 (02:28 +0200)
* commit 'b869eea7ea8f5d8331fcd6355f848bb6a6e06b14':
  h263dec: Fix order of initialization

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/h263dec.c

@@@ -510,11 -453,38 +498,22 @@@ retry
          return ret;
      }
  
+     if (!s->context_initialized)
+         if ((ret = ff_MPV_common_init(s)) < 0)
+             return ret;
+     if (s->current_picture_ptr == NULL || s->current_picture_ptr->f->data[0]) {
+         int i = ff_find_unused_picture(s, 0);
+         if (i < 0)
+             return i;
+         s->current_picture_ptr = &s->picture[i];
+     }
      avctx->has_b_frames = !s->low_delay;
  
 -#define SET_QPEL_FUNC(postfix1, postfix2)                           \
 -    s->qdsp.put_        ## postfix1 = ff_put_        ## postfix2;   \
 -    s->qdsp.put_no_rnd_ ## postfix1 = ff_put_no_rnd_ ## postfix2;   \
 -    s->qdsp.avg_        ## postfix1 = ff_avg_        ## postfix2;
 -
 -    if (s->workaround_bugs & FF_BUG_STD_QPEL) {
 -        SET_QPEL_FUNC(qpel_pixels_tab[0][5], qpel16_mc11_old_c)
 -        SET_QPEL_FUNC(qpel_pixels_tab[0][7], qpel16_mc31_old_c)
 -        SET_QPEL_FUNC(qpel_pixels_tab[0][9], qpel16_mc12_old_c)
 -        SET_QPEL_FUNC(qpel_pixels_tab[0][11], qpel16_mc32_old_c)
 -        SET_QPEL_FUNC(qpel_pixels_tab[0][13], qpel16_mc13_old_c)
 -        SET_QPEL_FUNC(qpel_pixels_tab[0][15], qpel16_mc33_old_c)
 -
 -        SET_QPEL_FUNC(qpel_pixels_tab[1][5], qpel8_mc11_old_c)
 -        SET_QPEL_FUNC(qpel_pixels_tab[1][7], qpel8_mc31_old_c)
 -        SET_QPEL_FUNC(qpel_pixels_tab[1][9], qpel8_mc12_old_c)
 -        SET_QPEL_FUNC(qpel_pixels_tab[1][11], qpel8_mc32_old_c)
 -        SET_QPEL_FUNC(qpel_pixels_tab[1][13], qpel8_mc13_old_c)
 -        SET_QPEL_FUNC(qpel_pixels_tab[1][15], qpel8_mc33_old_c)
 +    if (CONFIG_MPEG4_DECODER && avctx->codec_id == AV_CODEC_ID_MPEG4) {
 +        if (ff_mpeg4_workaround_bugs(avctx) == 1)
 +            goto retry;
      }
  
      /* After H263 & mpeg4 header decode we have the height, width,