mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-09-20 05:16:38 +00:00
lavfi/avcodec: always use av_frame* accessors in avfilter_copy_buf_props()
Use av_frame_* accessors for the newly added fields in AVFrame (for which we are supposed to use such accessors), and group the istructions accordingly.
This commit is contained in:
parent
d5761fe47d
commit
8f8d8b9538
@ -93,8 +93,8 @@ int avfilter_copy_buf_props(AVFrame *dst, const AVFilterBufferRef *src)
|
|||||||
memcpy(dst->linesize, src->linesize, sizeof(dst->linesize));
|
memcpy(dst->linesize, src->linesize, sizeof(dst->linesize));
|
||||||
|
|
||||||
dst->pts = src->pts;
|
dst->pts = src->pts;
|
||||||
dst->pkt_pos = src->pos;
|
|
||||||
dst->format = src->format;
|
dst->format = src->format;
|
||||||
|
av_frame_set_pkt_pos(dst, src->pos);
|
||||||
|
|
||||||
switch (src->type) {
|
switch (src->type) {
|
||||||
case AVMEDIA_TYPE_VIDEO:
|
case AVMEDIA_TYPE_VIDEO:
|
||||||
@ -120,10 +120,9 @@ int avfilter_copy_buf_props(AVFrame *dst, const AVFilterBufferRef *src)
|
|||||||
planes * sizeof(dst->extended_data));
|
planes * sizeof(dst->extended_data));
|
||||||
} else
|
} else
|
||||||
dst->extended_data = dst->data;
|
dst->extended_data = dst->data;
|
||||||
|
|
||||||
dst->sample_rate = src->audio->sample_rate;
|
|
||||||
dst->channel_layout = src->audio->channel_layout;
|
|
||||||
dst->nb_samples = src->audio->nb_samples;
|
dst->nb_samples = src->audio->nb_samples;
|
||||||
|
av_frame_set_sample_rate (dst, src->audio->sample_rate);
|
||||||
|
av_frame_set_channel_layout(dst, src->audio->channel_layout);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return AVERROR(EINVAL);
|
return AVERROR(EINVAL);
|
||||||
|
Loading…
Reference in New Issue
Block a user