]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/utils.c
lavc: use buf[0] instead of data[0] as the indicator of an allocated frame
[ffmpeg] / libavcodec / utils.c
index d21ca0eeceec186b67ce2d6788034e1b87fe3126..d1a1510858b2842e40fe024922e7cf0f4cd76925 100644 (file)
@@ -1416,7 +1416,7 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi
 
         emms_c(); //needed to avoid an emms_c() call before every return;
 
-        if (ret < 0 && picture->data[0])
+        if (ret < 0 && picture->buf[0])
             av_frame_unref(picture);
 
         if (*got_picture_ptr) {
@@ -1431,10 +1431,6 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi
     } else
         ret = 0;
 
-    /* many decoders assign whole AVFrames, thus overwriting extended_data;
-     * make sure it's set correctly */
-    picture->extended_data = picture->data;
-
     return ret;
 }
 
@@ -1444,7 +1440,6 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx,
                                               AVPacket *avpkt)
 {
     AVCodecInternal *avci = avctx->internal;
-    int planar, channels;
     int ret = 0;
 
     *got_frame_ptr = 0;
@@ -1487,13 +1482,6 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx,
             av_frame_unref(frame);
     }
 
-    /* many decoders assign whole AVFrames, thus overwriting extended_data;
-     * make sure it's set correctly; assume decoders that actually use
-     * extended_data are doing it correctly */
-    planar   = av_sample_fmt_is_planar(frame->format);
-    channels = av_get_channel_layout_nb_channels(frame->channel_layout);
-    if (!(planar && channels > AV_NUM_DATA_POINTERS))
-        frame->extended_data = frame->data;
 
     return ret;
 }