mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-06-17 11:45:11 +08:00
Check pkt.pts against the recording time.
This fixes at least ogg encoding with -t where the file was slightly too long. Originally committed as revision 21598 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
4
ffmpeg.c
4
ffmpeg.c
@ -2317,6 +2317,10 @@ static int av_encode(AVFormatContext **output_files,
|
||||
}
|
||||
}
|
||||
|
||||
/* finish if recording time exhausted */
|
||||
if (pkt.pts * av_q2d(ist->st->time_base) >= (recording_time / 1000000.0))
|
||||
goto discard_packet;
|
||||
|
||||
//fprintf(stderr,"read #%d.%d size=%d\n", ist->file_index, ist->index, pkt.size);
|
||||
if (output_packet(ist, ist_index, ost_table, nb_ostreams, &pkt) < 0) {
|
||||
|
||||
|
Reference in New Issue
Block a user