On 02/21/2012 06:08 PM, Paul B Mahol wrote: > This also improves seeking. > > Signed-off-by: Paul B Mahol <[email protected]> > --- > libavformat/cdxl.c | 4 +++- > 1 files changed, 3 insertions(+), 1 deletions(-) > > diff --git a/libavformat/cdxl.c b/libavformat/cdxl.c > index b056d69..7463001 100644 > --- a/libavformat/cdxl.c > +++ b/libavformat/cdxl.c > @@ -104,6 +104,7 @@ static int cdxl_read_packet(AVFormatContext *s, AVPacket > *pkt) > st->codec->channels = cdxl->header[1] & 0x10 ? 2 : 1; > st->codec->sample_rate = cdxl->sample_rate; > st->start_time = 0; > + st->duration = avio_size(pb) / current_size * > audio_size; > cdxl->audio_stream_index = st->index; > avpriv_set_pts_info(st, 64, 1, cdxl->sample_rate); > } > @@ -127,6 +128,7 @@ static int cdxl_read_packet(AVFormatContext *s, AVPacket > *pkt) > st->codec->width = width; > st->codec->height = height; > st->start_time = 0; > + st->duration = avio_size(pb) / current_size * > audio_size; > cdxl->video_stream_index = st->index; > if (cdxl->framerate) > avpriv_set_pts_info(st, 64, cdxl->fps.den, cdxl->fps.num);
The duration is based on the time_base, so you need to set it conditionally like you do for avpriv_set_pts_info(). -Justin _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
