Message ID | tencent_0F884C13EC536B35D56904EEB7C540D31405@qq.com |
---|---|
State | Accepted |
Commit | 94644343a66947d22253cfdd73531f0f670de5d8 |
Headers | show |
Series | [FFmpeg-devel,1/2] avformat/mp3dec: avoid seek back and forth | expand |
Context | Check | Description |
---|---|---|
andriy/make_x86 | success | Make finished |
andriy/make_fate_x86 | success | Make fate finished |
Quoting Zhao Zhili (2022-09-25 06:28:41) > From: Zhao Zhili <zhilizhao@tencent.com> > > --- > libavformat/mp3dec.c | 9 ++++----- > 1 file changed, 4 insertions(+), 5 deletions(-) > > diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c > index a9e494452d..05c13228bc 100644 > --- a/libavformat/mp3dec.c > +++ b/libavformat/mp3dec.c > @@ -424,15 +424,14 @@ static int mp3_read_header(AVFormatContext *s) > } > } > if (i == 64 * 1024) { > - ret = avio_seek(s->pb, off, SEEK_SET); > + off = avio_seek(s->pb, off, SEEK_SET); > } else { > av_log(s, i > 0 ? AV_LOG_INFO : AV_LOG_VERBOSE, "Skipping %d bytes of junk at %"PRId64".\n", i, off); > - ret = avio_seek(s->pb, off + i, SEEK_SET); > + off = avio_seek(s->pb, off + i, SEEK_SET); > } > - if (ret < 0) > - return ret; > + if (off < 0) > + return off; > > - off = avio_tell(s->pb); Looks ok.
On Tue, 2022-10-04 at 11:01 +0200, Anton Khirnov wrote: > Quoting Zhao Zhili (2022-09-25 06:28:41) > > From: Zhao Zhili <zhilizhao@tencent.com> > > > > --- > > libavformat/mp3dec.c | 9 ++++----- > > 1 file changed, 4 insertions(+), 5 deletions(-) > > Looks ok. Pushed, thanks for review.
diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c index a9e494452d..05c13228bc 100644 --- a/libavformat/mp3dec.c +++ b/libavformat/mp3dec.c @@ -424,15 +424,14 @@ static int mp3_read_header(AVFormatContext *s) } } if (i == 64 * 1024) { - ret = avio_seek(s->pb, off, SEEK_SET); + off = avio_seek(s->pb, off, SEEK_SET); } else { av_log(s, i > 0 ? AV_LOG_INFO : AV_LOG_VERBOSE, "Skipping %d bytes of junk at %"PRId64".\n", i, off); - ret = avio_seek(s->pb, off + i, SEEK_SET); + off = avio_seek(s->pb, off + i, SEEK_SET); } - if (ret < 0) - return ret; + if (off < 0) + return off; - off = avio_tell(s->pb); // the seek index is relative to the end of the xing vbr headers for (int i = 0; i < sti->nb_index_entries; i++) sti->index_entries[i].pos += off;
From: Zhao Zhili <zhilizhao@tencent.com> --- libavformat/mp3dec.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)