avdevice/lavfi: replace deprecated avpicture_layout

Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
Paul B Mahol 2016-01-31 17:40:55 +01:00
parent 0a7379d9cf
commit 75f3e5e082

View File

@ -382,7 +382,6 @@ static int lavfi_read_packet(AVFormatContext *avctx, AVPacket *pkt)
double min_pts = DBL_MAX; double min_pts = DBL_MAX;
int stream_idx, min_pts_sink_idx = 0; int stream_idx, min_pts_sink_idx = 0;
AVFrame *frame = lavfi->decoded_frame; AVFrame *frame = lavfi->decoded_frame;
AVPicture pict;
AVDictionary *frame_metadata; AVDictionary *frame_metadata;
int ret, i; int ret, i;
int size = 0; int size = 0;
@ -435,11 +434,8 @@ static int lavfi_read_packet(AVFormatContext *avctx, AVPacket *pkt)
if ((ret = av_new_packet(pkt, size)) < 0) if ((ret = av_new_packet(pkt, size)) < 0)
return ret; return ret;
memcpy(pict.data, frame->data, 4*sizeof(frame->data[0])); av_image_copy_to_buffer(pkt->data, size, (const uint8_t **)frame->data, frame->linesize,
memcpy(pict.linesize, frame->linesize, 4*sizeof(frame->linesize[0])); frame->format, frame->width, frame->height, 1);
avpicture_layout(&pict, frame->format, frame->width, frame->height,
pkt->data, size);
} else if (av_frame_get_channels(frame) /* FIXME test audio */) { } else if (av_frame_get_channels(frame) /* FIXME test audio */) {
size = frame->nb_samples * av_get_bytes_per_sample(frame->format) * size = frame->nb_samples * av_get_bytes_per_sample(frame->format) *
av_frame_get_channels(frame); av_frame_get_channels(frame);