summaryrefslogtreecommitdiff
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2010-02-01 22:08:45 +0000
committerMichael Niedermayer <michaelni@gmx.at>2010-02-01 22:08:45 +0000
commitf8ccf7200575390b5e40ff3762566786db435ac0 (patch)
tree2dcbeacdaff3502162907a6cb6051c3f7c180d65 /ffmpeg.c
parentd2a2b08cfe2ab382a4ad756c0a08ff78eb284ef9 (diff)
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
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 9f19b06e5d..3ffd596c09 100644
--- a/ffmpeg.c
+++ b/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) {