1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec: use av_frame_unref() to set frame defaults

This ensures that the code isnt duplicated and cant become out of sync

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-12-17 14:02:29 +01:00
parent 745c40a47f
commit 6aed7bfd84

View File

@ -1062,19 +1062,7 @@ void avcodec_get_frame_defaults(AVFrame *frame)
#endif #endif
memset(frame, 0, sizeof(AVFrame)); memset(frame, 0, sizeof(AVFrame));
av_frame_unref(frame);
frame->pts =
frame->pkt_dts =
frame->pkt_pts = AV_NOPTS_VALUE;
av_frame_set_best_effort_timestamp(frame, AV_NOPTS_VALUE);
av_frame_set_pkt_duration (frame, 0);
av_frame_set_pkt_pos (frame, -1);
av_frame_set_pkt_size (frame, -1);
frame->key_frame = 1;
frame->sample_aspect_ratio = (AVRational) {0, 1 };
frame->format = -1; /* unknown */
frame->extended_data = frame->data;
av_frame_set_colorspace(frame, AVCOL_SPC_UNSPECIFIED);
} }
AVFrame *avcodec_alloc_frame(void) AVFrame *avcodec_alloc_frame(void)