Commit bc3429e3 authored by Michael Niedermayer's avatar Michael Niedermayer

pts/dts 100l fix

Originally committed as revision 3553 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 7e051558
......@@ -895,6 +895,7 @@ static int output_packet(AVFormatContext *ctx, int flush){
int best_score= INT_MIN;
int ignore_constraints=0;
int64_t scr= s->last_scr;
PacketDesc *timestamp_packet;
retry:
for(i=0; i<ctx->nb_streams; i++){
......@@ -957,12 +958,20 @@ retry:
assert(avail_space >= s->packet_size || ignore_constraints);
if(stream->premux_packet->unwritten_size == stream->premux_packet->size)
timestamp_packet= stream->premux_packet;
if(timestamp_packet->unwritten_size == timestamp_packet->size){
trailer_size= 0;
else
trailer_size= stream->premux_packet->unwritten_size;
}else{
trailer_size= timestamp_packet->unwritten_size;
timestamp_packet= timestamp_packet->next;
}
es_size= flush_packet(ctx, best_i, stream->premux_packet->pts, stream->premux_packet->dts, scr, trailer_size);
if(timestamp_packet){
es_size= flush_packet(ctx, best_i, timestamp_packet->pts, timestamp_packet->dts, scr, trailer_size);
}else{
assert(fifo_size(&stream->fifo, stream->fifo.rptr) == trailer_size);
es_size= flush_packet(ctx, best_i, AV_NOPTS_VALUE, AV_NOPTS_VALUE, scr, trailer_size);
}
if (s->is_vcd) {
/* Write one or more padding sectors, if necessary, to reach
......
......@@ -7,7 +7,7 @@ ffmpeg regression test
./data/b-libav.asf CRC=750f18c7
1cbf838e659d7fc3d3e33f4187b91f6c *./data/b-libav.rm
360251 ./data/b-libav.rm
82d8794cc5eaf220b2f260ceacaf3a3b *./data/b-libav.mpg
65af12e9d9e8eb76af5efdadf769d7d7 *./data/b-libav.mpg
387072 ./data/b-libav.mpg
./data/b-libav.mpg CRC=16c74225
57a8dfc7926802bb337a9d8918de94a8 *./data/b-libav.swf
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment