Mercurial > libavformat.hg
comparison mpeg.c @ 545:afe2c9a33928 libavformat
pts/dts 100l fix
author | michael |
---|---|
date | Sun, 03 Oct 2004 11:16:40 +0000 |
parents | 1244786bfb26 |
children | 7c5ec900b38a |
comparison
equal
deleted
inserted
replaced
544:1244786bfb26 | 545:afe2c9a33928 |
---|---|
893 int i, avail_space, es_size, trailer_size; | 893 int i, avail_space, es_size, trailer_size; |
894 int best_i= -1; | 894 int best_i= -1; |
895 int best_score= INT_MIN; | 895 int best_score= INT_MIN; |
896 int ignore_constraints=0; | 896 int ignore_constraints=0; |
897 int64_t scr= s->last_scr; | 897 int64_t scr= s->last_scr; |
898 PacketDesc *timestamp_packet; | |
898 | 899 |
899 retry: | 900 retry: |
900 for(i=0; i<ctx->nb_streams; i++){ | 901 for(i=0; i<ctx->nb_streams; i++){ |
901 AVStream *st = ctx->streams[i]; | 902 AVStream *st = ctx->streams[i]; |
902 StreamInfo *stream = st->priv_data; | 903 StreamInfo *stream = st->priv_data; |
955 | 956 |
956 assert(fifo_size(&stream->fifo, stream->fifo.rptr) > 0); | 957 assert(fifo_size(&stream->fifo, stream->fifo.rptr) > 0); |
957 | 958 |
958 assert(avail_space >= s->packet_size || ignore_constraints); | 959 assert(avail_space >= s->packet_size || ignore_constraints); |
959 | 960 |
960 if(stream->premux_packet->unwritten_size == stream->premux_packet->size) | 961 timestamp_packet= stream->premux_packet; |
962 if(timestamp_packet->unwritten_size == timestamp_packet->size){ | |
961 trailer_size= 0; | 963 trailer_size= 0; |
962 else | 964 }else{ |
963 trailer_size= stream->premux_packet->unwritten_size; | 965 trailer_size= timestamp_packet->unwritten_size; |
964 | 966 timestamp_packet= timestamp_packet->next; |
965 es_size= flush_packet(ctx, best_i, stream->premux_packet->pts, stream->premux_packet->dts, scr, trailer_size); | 967 } |
968 | |
969 if(timestamp_packet){ | |
970 es_size= flush_packet(ctx, best_i, timestamp_packet->pts, timestamp_packet->dts, scr, trailer_size); | |
971 }else{ | |
972 assert(fifo_size(&stream->fifo, stream->fifo.rptr) == trailer_size); | |
973 es_size= flush_packet(ctx, best_i, AV_NOPTS_VALUE, AV_NOPTS_VALUE, scr, trailer_size); | |
974 } | |
966 | 975 |
967 if (s->is_vcd) { | 976 if (s->is_vcd) { |
968 /* Write one or more padding sectors, if necessary, to reach | 977 /* Write one or more padding sectors, if necessary, to reach |
969 the constant overall bitrate.*/ | 978 the constant overall bitrate.*/ |
970 int vcd_pad_bytes; | 979 int vcd_pad_bytes; |