pts/dts 100l fix

Originally committed as revision 3553 to svn://svn.ffmpeg.org/ffmpeg/trunk
pull/126/head
Michael Niedermayer 21 years ago
parent 7e05155850
commit bc3429e382
  1. 17
      libavformat/mpeg.c
  2. 2
      tests/libav.regression.ref

@ -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

Loading…
Cancel
Save