--- libavformat/brstm.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/libavformat/brstm.c b/libavformat/brstm.c index b83d8d0..49f71fc 100644 --- a/libavformat/brstm.c +++ b/libavformat/brstm.c @@ -89,10 +89,11 @@ static int read_header(AVFormatContext *s) { BRSTMDemuxContext *b = s->priv_data; int bom, major, minor, codec, chunk; - int64_t h1offset, pos, toffset; - uint32_t size, asize, start = 0; + int64_t h1offset, pos, toffset, data_offset = 0; + uint32_t size, start, asize; AVStream *st; int ret = AVERROR_EOF; + int loop = 0; int bfstm = !strcmp("bfstm", s->iformat->name); st = avformat_new_stream(s, NULL); @@ -193,7 +194,7 @@ static int read_header(AVFormatContext *s) return AVERROR_PATCHWELCOME; } - avio_skip(s->pb, 1); // loop flag + loop = avio_r8(s->pb); // loop flag st->codec->codec_id = codec; st->codec->channels = avio_r8(s->pb); if (!st->codec->channels) @@ -207,7 +208,12 @@ static int read_header(AVFormatContext *s) if (!bfstm) avio_skip(s->pb, 2); // padding - avio_skip(s->pb, 4); // loop start sample + + if (loop) + s->loop_start = av_rescale(avio_rb32(s->pb), AV_TIME_BASE, st->codec->sample_rate); + else + avio_skip(s->pb, 4); + st->start_time = 0; st->duration = read32(s); avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate); -- 2.4.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel