You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
ffmpeg: Avoid directly accessing AVFrame fields that differ between forks.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
12
ffmpeg.c
12
ffmpeg.c
@@ -1841,6 +1841,8 @@ static int transcode_video(InputStream *ist, AVPacket *pkt, int *got_output, int
|
|||||||
int frame_available = 1;
|
int frame_available = 1;
|
||||||
#endif
|
#endif
|
||||||
int duration=0;
|
int duration=0;
|
||||||
|
int64_t *best_effort_timestamp;
|
||||||
|
AVRational *frame_sample_aspect;
|
||||||
|
|
||||||
if (!(decoded_frame = avcodec_alloc_frame()))
|
if (!(decoded_frame = avcodec_alloc_frame()))
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
@@ -1874,8 +1876,9 @@ static int transcode_video(InputStream *ist, AVPacket *pkt, int *got_output, int
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(decoded_frame->best_effort_timestamp != AV_NOPTS_VALUE)
|
best_effort_timestamp= av_opt_ptr(avcodec_get_frame_class(), decoded_frame, "best_effort_timestamp");
|
||||||
ist->next_pts = ist->pts = decoded_frame->best_effort_timestamp;
|
if(*best_effort_timestamp != AV_NOPTS_VALUE)
|
||||||
|
ist->next_pts = ist->pts = *best_effort_timestamp;
|
||||||
|
|
||||||
ist->next_pts += duration;
|
ist->next_pts += duration;
|
||||||
pkt->size = 0;
|
pkt->size = 0;
|
||||||
@@ -1883,11 +1886,12 @@ static int transcode_video(InputStream *ist, AVPacket *pkt, int *got_output, int
|
|||||||
pre_process_video_frame(ist, (AVPicture *)decoded_frame, &buffer_to_free);
|
pre_process_video_frame(ist, (AVPicture *)decoded_frame, &buffer_to_free);
|
||||||
|
|
||||||
#if CONFIG_AVFILTER
|
#if CONFIG_AVFILTER
|
||||||
|
frame_sample_aspect= av_opt_ptr(avcodec_get_frame_class(), decoded_frame, "sample_aspect_ratio");
|
||||||
for(i=0;i<nb_output_streams;i++) {
|
for(i=0;i<nb_output_streams;i++) {
|
||||||
OutputStream *ost = ost = &output_streams[i];
|
OutputStream *ost = ost = &output_streams[i];
|
||||||
if(check_output_constraints(ist, ost)){
|
if(check_output_constraints(ist, ost)){
|
||||||
if (!decoded_frame->sample_aspect_ratio.num)
|
if (!frame_sample_aspect->num)
|
||||||
decoded_frame->sample_aspect_ratio = ist->st->sample_aspect_ratio;
|
*frame_sample_aspect = ist->st->sample_aspect_ratio;
|
||||||
decoded_frame->pts = ist->pts;
|
decoded_frame->pts = ist->pts;
|
||||||
|
|
||||||
av_vsrc_buffer_add_frame(ost->input_video_filter, decoded_frame, AV_VSRC_BUF_FLAG_OVERWRITE);
|
av_vsrc_buffer_add_frame(ost->input_video_filter, decoded_frame, AV_VSRC_BUF_FLAG_OVERWRITE);
|
||||||
|
Reference in New Issue
Block a user