summaryrefslogtreecommitdiff
path: root/libavformat/3dostr.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-07-27 05:19:18 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-08-05 23:14:39 +0200
commitedcd7c735c098a3b72cada2c791d04b4428b145d (patch)
treeb187d6cc7a639c425165c3865bd40822ae41af6a /libavformat/3dostr.c
parentbecfdaaa0961fcdfea5e7be102d59e5861e5adea (diff)
downloadffmpeg-edcd7c735c098a3b72cada2c791d04b4428b145d.tar.gz
avformat/3dostr: Return directly after having read packet
Avoids an avio_skip(s->pb, 0). Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavformat/3dostr.c')
-rw-r--r--libavformat/3dostr.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/libavformat/3dostr.c b/libavformat/3dostr.c
index 6c49f7589c..3ec3c4393e 100644
--- a/libavformat/3dostr.c
+++ b/libavformat/3dostr.c
@@ -110,15 +110,12 @@ static int threedostr_read_header(AVFormatContext *s)
static int threedostr_read_packet(AVFormatContext *s, AVPacket *pkt)
{
- unsigned chunk, size, found_ssmp = 0;
+ unsigned chunk, size;
AVStream *st = s->streams[0];
int64_t pos;
int ret = 0;
- while (!found_ssmp) {
- if (avio_feof(s->pb))
- return AVERROR_EOF;
-
+ while (!avio_feof(s->pb)) {
pos = avio_tell(s->pb);
chunk = avio_rl32(s->pb);
size = avio_rb32(s->pb);
@@ -143,9 +140,7 @@ static int threedostr_read_packet(AVFormatContext *s, AVPacket *pkt)
pkt->pos = pos;
pkt->stream_index = 0;
pkt->duration = size / st->codecpar->channels;
- size = 0;
- found_ssmp = 1;
- break;
+ return ret;
default:
av_log(s, AV_LOG_DEBUG, "skipping unknown chunk: %X\n", chunk);
break;
@@ -154,7 +149,7 @@ static int threedostr_read_packet(AVFormatContext *s, AVPacket *pkt)
avio_skip(s->pb, size);
}
- return ret;
+ return AVERROR_EOF;
}
AVInputFormat ff_threedostr_demuxer = {