} 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;
}
int *got_frame_ptr,
AVPacket *avpkt)
{
+ int planar, channels;
int ret = 0;
*got_frame_ptr = 0;
frame->format = avctx->sample_fmt;
}
}
+
+ /* 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;
}