You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
Make rate_emu a global property rather than to be settable for a
specific input video stream. See the thread: Fix ffmpeg -re behaviour. Originally committed as revision 15946 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
6
ffmpeg.c
6
ffmpeg.c
@@ -1304,7 +1304,7 @@ static int output_packet(AVInputStream *ist, int ist_index,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* frame rate emulation */
|
/* frame rate emulation */
|
||||||
if (ist->st->codec->rate_emu) {
|
if (rate_emu) {
|
||||||
int64_t pts = av_rescale(ist->pts, 1000000, AV_TIME_BASE);
|
int64_t pts = av_rescale(ist->pts, 1000000, AV_TIME_BASE);
|
||||||
int64_t now = av_gettime() - ist->start;
|
int64_t now = av_gettime() - ist->start;
|
||||||
if (pts > now)
|
if (pts > now)
|
||||||
@@ -1567,7 +1567,7 @@ static int av_encode(AVFormatContext **output_files,
|
|||||||
ist->discard = 1; /* the stream is discarded by default
|
ist->discard = 1; /* the stream is discarded by default
|
||||||
(changed later) */
|
(changed later) */
|
||||||
|
|
||||||
if (ist->st->codec->rate_emu) {
|
if (rate_emu) {
|
||||||
ist->start = av_gettime();
|
ist->start = av_gettime();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2854,7 +2854,6 @@ static void opt_input_file(const char *filename)
|
|||||||
frame_rate.num = rfps;
|
frame_rate.num = rfps;
|
||||||
frame_rate.den = rfps_base;
|
frame_rate.den = rfps_base;
|
||||||
|
|
||||||
enc->rate_emu = rate_emu;
|
|
||||||
input_codecs[nb_icodecs++] = avcodec_find_decoder_by_name(video_codec_name);
|
input_codecs[nb_icodecs++] = avcodec_find_decoder_by_name(video_codec_name);
|
||||||
if(video_disable)
|
if(video_disable)
|
||||||
ic->streams[i]->discard= AVDISCARD_ALL;
|
ic->streams[i]->discard= AVDISCARD_ALL;
|
||||||
@@ -2889,7 +2888,6 @@ static void opt_input_file(const char *filename)
|
|||||||
|
|
||||||
video_channel = 0;
|
video_channel = 0;
|
||||||
|
|
||||||
rate_emu = 0;
|
|
||||||
av_freep(&video_codec_name);
|
av_freep(&video_codec_name);
|
||||||
av_freep(&audio_codec_name);
|
av_freep(&audio_codec_name);
|
||||||
av_freep(&subtitle_codec_name);
|
av_freep(&subtitle_codec_name);
|
||||||
|
Reference in New Issue
Block a user