diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2004-10-03 11:16:40 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2004-10-03 11:16:40 +0000 |
commit | bc3429e382151af6f10c7e1e2410bb0e0e4cf282 (patch) | |
tree | c4b4a95bdb686f6d2c4f5f112a842b12da8ef97b /libavformat/mpeg.c | |
parent | 7e05155850c5f1fee4f7e8b562af9d5cfcbb1d68 (diff) | |
download | ffmpeg-bc3429e382151af6f10c7e1e2410bb0e0e4cf282.tar.gz |
pts/dts 100l fix
Originally committed as revision 3553 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/mpeg.c')
-rw-r--r-- | libavformat/mpeg.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c index 9eaf3b3ac4..eb97bc4eb8 100644 --- a/libavformat/mpeg.c +++ b/libavformat/mpeg.c @@ -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 |