Commit e34e7a57 authored by James Almer's avatar James Almer

avformat/dtshddec: move data_start outside of DTSHDDemuxContext

It's only used in dtshd_read_header()
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent df01a29c
...@@ -40,7 +40,6 @@ ...@@ -40,7 +40,6 @@
#define TIMECODE 0x54494D45434F4445 #define TIMECODE 0x54494D45434F4445
typedef struct DTSHDDemuxContext { typedef struct DTSHDDemuxContext {
uint64_t data_start;
uint64_t data_end; uint64_t data_end;
} DTSHDDemuxContext; } DTSHDDemuxContext;
...@@ -56,7 +55,7 @@ static int dtshd_read_header(AVFormatContext *s) ...@@ -56,7 +55,7 @@ static int dtshd_read_header(AVFormatContext *s)
DTSHDDemuxContext *dtshd = s->priv_data; DTSHDDemuxContext *dtshd = s->priv_data;
AVIOContext *pb = s->pb; AVIOContext *pb = s->pb;
uint64_t chunk_type, chunk_size; uint64_t chunk_type, chunk_size;
int64_t duration; int64_t duration, data_start;
AVStream *st; AVStream *st;
int ret; int ret;
char *value; char *value;
...@@ -86,8 +85,8 @@ static int dtshd_read_header(AVFormatContext *s) ...@@ -86,8 +85,8 @@ static int dtshd_read_header(AVFormatContext *s)
switch (chunk_type) { switch (chunk_type) {
case STRMDATA: case STRMDATA:
dtshd->data_start = avio_tell(pb); data_start = avio_tell(pb);
dtshd->data_end = dtshd->data_start + chunk_size; dtshd->data_end = data_start + chunk_size;
if (dtshd->data_end <= chunk_size) if (dtshd->data_end <= chunk_size)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
if (!pb->seekable) if (!pb->seekable)
...@@ -131,7 +130,7 @@ skip: ...@@ -131,7 +130,7 @@ skip:
if (!dtshd->data_end) if (!dtshd->data_end)
return AVERROR_EOF; return AVERROR_EOF;
avio_seek(pb, dtshd->data_start, SEEK_SET); avio_seek(pb, data_start, SEEK_SET);
break_loop: break_loop:
if (st->codecpar->sample_rate) if (st->codecpar->sample_rate)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment