mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-25 08:42:39 +00:00
Merge commit 'b0f36a0043d76436cc7ab8ff92ab99c94595d3c0'
* commit 'b0f36a0043d76436cc7ab8ff92ab99c94595d3c0': avconv: stop using setpts for input framerate forced with -r Merged-by: Clément Bœsch <u@pkh.me>
This commit is contained in:
commit
993a9a3d72
2
configure
vendored
2
configure
vendored
@ -3192,7 +3192,7 @@ swscale_deps="avutil"
|
||||
ffmpeg_deps="avcodec avfilter avformat swresample"
|
||||
ffmpeg_select="aformat_filter anull_filter atrim_filter format_filter
|
||||
null_filter
|
||||
setpts_filter trim_filter"
|
||||
trim_filter"
|
||||
ffplay_deps="avcodec avformat swscale swresample sdl2"
|
||||
ffplay_libs='$sdl2_libs'
|
||||
ffplay_select="rdft crop_filter transpose_filter hflip_filter vflip_filter rotate_filter"
|
||||
|
3
ffmpeg.c
3
ffmpeg.c
@ -2437,6 +2437,9 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output, int eo
|
||||
|
||||
best_effort_timestamp= av_frame_get_best_effort_timestamp(decoded_frame);
|
||||
|
||||
if (ist->framerate.num)
|
||||
best_effort_timestamp = ist->cfr_next_pts++;
|
||||
|
||||
if (eof && best_effort_timestamp == AV_NOPTS_VALUE && ist->nb_dts_buffer > 0) {
|
||||
best_effort_timestamp = ist->dts_buffer[0];
|
||||
|
||||
|
5
ffmpeg.h
5
ffmpeg.h
@ -316,6 +316,11 @@ typedef struct InputStream {
|
||||
|
||||
int64_t min_pts; /* pts with the smallest value in a current stream */
|
||||
int64_t max_pts; /* pts with the higher value in a current stream */
|
||||
|
||||
// when forcing constant input framerate through -r,
|
||||
// this contains the pts that will be given to the next decoded frame
|
||||
int64_t cfr_next_pts;
|
||||
|
||||
int64_t nb_samples; /* number of samples in the last decoded audio frame before looping */
|
||||
|
||||
double ts_scale;
|
||||
|
@ -802,23 +802,6 @@ static int configure_input_video_filter(FilterGraph *fg, InputFilter *ifilter,
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (ist->framerate.num) {
|
||||
AVFilterContext *setpts;
|
||||
|
||||
snprintf(name, sizeof(name), "forcecfr_in_%d_%d",
|
||||
ist->file_index, ist->st->index);
|
||||
if ((ret = avfilter_graph_create_filter(&setpts,
|
||||
avfilter_get_by_name("setpts"),
|
||||
name, "N", NULL,
|
||||
fg->graph)) < 0)
|
||||
return ret;
|
||||
|
||||
if ((ret = avfilter_link(last_filter, 0, setpts, 0)) < 0)
|
||||
return ret;
|
||||
|
||||
last_filter = setpts;
|
||||
}
|
||||
|
||||
if (do_deinterlace) {
|
||||
AVFilterContext *yadif;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user