Merge commit 'e2274aa555f023e4f4e4819bf29b2d7e0adec7d5'
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 9 Dec 2013 11:32:37 +0000 (12:32 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 9 Dec 2013 11:42:10 +0000 (12:42 +0100)
* commit 'e2274aa555f023e4f4e4819bf29b2d7e0adec7d5':
  mjpegdec: use the AVFrame API properly.

Conflicts:
libavcodec/mjpegdec.c

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

@@@ -1367,10 -1097,9 +1370,10 @@@ int ff_mjpeg_decode_sos(MJpegDecodeCont
  
  next_field:
      for (i = 0; i < nb_components; i++)
 -        s->last_dc[i] = 1024;
 +        s->last_dc[i] = (4 << s->bits);
  
      if (s->lossless) {
-         av_assert0(s->picture_ptr == &s->picture);
++        av_assert0(s->picture_ptr == s->picture);
          if (CONFIG_JPEGLS_DECODER && s->ls) {
  //            for () {
  //            reset_ls_coding_parameters(s, 0);
          }
      } else {
          if (s->progressive && predictor) {
-             av_assert0(s->picture_ptr == &s->picture);
++            av_assert0(s->picture_ptr == s->picture);
              if ((ret = mjpeg_decode_scan_progressive_ac(s, predictor,
                                                          ilv, prev_shift,
 -                                                        point_transform,
 -                                                        mb_bitmask,
 -                                                        reference)) < 0)
 +                                                        point_transform)) < 0)
                  return ret;
          } else {
              if ((ret = mjpeg_decode_scan(s, nb_components,
@@@ -2033,11 -1655,10 +2036,14 @@@ av_cold int ff_mjpeg_decode_end(AVCodec
      MJpegDecodeContext *s = avctx->priv_data;
      int i, j;
  
-     if (s->picture_ptr)
 +    if (s->interlaced && s->bottom_field == !s->interlace_polarity && s->got_picture && !avctx->frame_number) {
 +        av_log(avctx, AV_LOG_INFO, "Single field\n");
 +    }
 +
+     if (s->picture) {
+         av_frame_free(&s->picture);
+         s->picture_ptr = NULL;
+     } else if (s->picture_ptr)
          av_frame_unref(s->picture_ptr);
  
      av_free(s->buffer);
Simple merge