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:
parent
d2a2b08cfe
commit
f8ccf72005
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);
|
//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) {
|
if (output_packet(ist, ist_index, ost_table, nb_ostreams, &pkt) < 0) {
|
||||||
|
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
767a75e9abf9754bfdc880d6faed69cf *./tests/data/b-lavf.ogg
|
89faca973d88ff2f5dd20992a11de107 *./tests/data/b-lavf.ogg
|
||||||
14210 ./tests/data/b-lavf.ogg
|
14063 ./tests/data/b-lavf.ogg
|
||||||
./tests/data/b-lavf.ogg CRC=0x37a143ea
|
./tests/data/b-lavf.ogg CRC=0xf1ae5536
|
||||||
|
@ -3387,7 +3387,7 @@ ret: 0 st: 0 flags:1 dts: NOPTS pts: NOPTS pos: -1 size: 1365
|
|||||||
ret: 0 st: 0 flags:1 ts:-0.317506
|
ret: 0 st: 0 flags:1 ts:-0.317506
|
||||||
ret: 0 st: 0 flags:1 dts: NOPTS pts: NOPTS pos: -1 size: 1384
|
ret: 0 st: 0 flags:1 dts: NOPTS pts: NOPTS pos: -1 size: 1384
|
||||||
ret: 0 st:-1 flags:0 ts: 2.576668
|
ret: 0 st:-1 flags:0 ts: 2.576668
|
||||||
ret: 0 st: 0 flags:1 dts: NOPTS pts: NOPTS pos: -1 size: 1369
|
ret: 0 st: 0 flags:1 dts: NOPTS pts: NOPTS pos: -1 size: 1223
|
||||||
ret: 0 st:-1 flags:1 ts: 1.470835
|
ret: 0 st:-1 flags:1 ts: 1.470835
|
||||||
ret:-EIO
|
ret:-EIO
|
||||||
ret: 0 st: 0 flags:0 ts: 0.365011
|
ret: 0 st: 0 flags:0 ts: 0.365011
|
||||||
@ -3395,7 +3395,7 @@ ret: 0 st: 0 flags:1 dts: NOPTS pts: NOPTS pos: -1 size: 1390
|
|||||||
ret: 0 st: 0 flags:1 ts:-0.740839
|
ret: 0 st: 0 flags:1 ts:-0.740839
|
||||||
ret: 0 st: 0 flags:1 dts: NOPTS pts: NOPTS pos: -1 size: 1384
|
ret: 0 st: 0 flags:1 dts: NOPTS pts: NOPTS pos: -1 size: 1384
|
||||||
ret: 0 st:-1 flags:0 ts: 2.153336
|
ret: 0 st:-1 flags:0 ts: 2.153336
|
||||||
ret: 0 st: 0 flags:1 dts: NOPTS pts: NOPTS pos: -1 size: 1369
|
ret: 0 st: 0 flags:1 dts: NOPTS pts: NOPTS pos: -1 size: 1223
|
||||||
ret: 0 st:-1 flags:1 ts: 1.047503
|
ret: 0 st:-1 flags:1 ts: 1.047503
|
||||||
ret:-EIO
|
ret:-EIO
|
||||||
ret: 0 st: 0 flags:0 ts:-0.058322
|
ret: 0 st: 0 flags:0 ts:-0.058322
|
||||||
@ -3403,7 +3403,7 @@ ret: 0 st: 0 flags:1 dts: NOPTS pts: NOPTS pos: -1 size: 1390
|
|||||||
ret: 0 st: 0 flags:1 ts: 2.835828
|
ret: 0 st: 0 flags:1 ts: 2.835828
|
||||||
ret:-EIO
|
ret:-EIO
|
||||||
ret: 0 st:-1 flags:0 ts: 1.730004
|
ret: 0 st:-1 flags:0 ts: 1.730004
|
||||||
ret: 0 st: 0 flags:1 dts: NOPTS pts: NOPTS pos: -1 size: 1369
|
ret: 0 st: 0 flags:1 dts: NOPTS pts: NOPTS pos: -1 size: 1223
|
||||||
ret: 0 st:-1 flags:1 ts: 0.624171
|
ret: 0 st:-1 flags:1 ts: 0.624171
|
||||||
ret: 0 st: 0 flags:1 dts: NOPTS pts: NOPTS pos: -1 size: 1370
|
ret: 0 st: 0 flags:1 dts: NOPTS pts: NOPTS pos: -1 size: 1370
|
||||||
ret: 0 st: 0 flags:0 ts:-0.481655
|
ret: 0 st: 0 flags:0 ts:-0.481655
|
||||||
@ -3411,7 +3411,7 @@ ret: 0 st: 0 flags:1 dts: NOPTS pts: NOPTS pos: -1 size: 1390
|
|||||||
ret: 0 st: 0 flags:1 ts: 2.412494
|
ret: 0 st: 0 flags:1 ts: 2.412494
|
||||||
ret:-EIO
|
ret:-EIO
|
||||||
ret: 0 st:-1 flags:0 ts: 1.306672
|
ret: 0 st:-1 flags:0 ts: 1.306672
|
||||||
ret: 0 st: 0 flags:1 dts: NOPTS pts: NOPTS pos: -1 size: 1369
|
ret: 0 st: 0 flags:1 dts: NOPTS pts: NOPTS pos: -1 size: 1223
|
||||||
ret: 0 st:-1 flags:1 ts: 0.200839
|
ret: 0 st:-1 flags:1 ts: 0.200839
|
||||||
ret: 0 st: 0 flags:1 dts: NOPTS pts: NOPTS pos: -1 size: 1384
|
ret: 0 st: 0 flags:1 dts: NOPTS pts: NOPTS pos: -1 size: 1384
|
||||||
ret: 0 st: 0 flags:0 ts:-0.904989
|
ret: 0 st: 0 flags:0 ts:-0.904989
|
||||||
@ -3419,11 +3419,11 @@ ret: 0 st: 0 flags:1 dts: NOPTS pts: NOPTS pos: -1 size: 1390
|
|||||||
ret: 0 st: 0 flags:1 ts: 1.989184
|
ret: 0 st: 0 flags:1 ts: 1.989184
|
||||||
ret:-EIO
|
ret:-EIO
|
||||||
ret: 0 st:-1 flags:0 ts: 0.883340
|
ret: 0 st:-1 flags:0 ts: 0.883340
|
||||||
ret:-EIO
|
ret: 0 st: 0 flags:1 dts: NOPTS pts: NOPTS pos: -1 size: 1223
|
||||||
ret: 0 st:-1 flags:1 ts:-0.222493
|
ret: 0 st:-1 flags:1 ts:-0.222493
|
||||||
ret: 0 st: 0 flags:1 dts: NOPTS pts: NOPTS pos: -1 size: 1384
|
ret: 0 st: 0 flags:1 dts: NOPTS pts: NOPTS pos: -1 size: 1384
|
||||||
ret: 0 st: 0 flags:0 ts: 2.671678
|
ret: 0 st: 0 flags:0 ts: 2.671678
|
||||||
ret: 0 st: 0 flags:1 dts: NOPTS pts: NOPTS pos: -1 size: 1369
|
ret: 0 st: 0 flags:1 dts: NOPTS pts: NOPTS pos: -1 size: 1223
|
||||||
ret: 0 st: 0 flags:1 ts: 1.565850
|
ret: 0 st: 0 flags:1 ts: 1.565850
|
||||||
ret:-EIO
|
ret:-EIO
|
||||||
ret: 0 st:-1 flags:0 ts: 0.460008
|
ret: 0 st:-1 flags:0 ts: 0.460008
|
||||||
|
Loading…
x
Reference in New Issue
Block a user