aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/dv.c
diff options
context:
space:
mode:
authorClément Bœsch <u@pkh.me>2016-03-20 16:14:22 +0100
committerClément Bœsch <u@pkh.me>2016-03-20 19:28:15 +0100
commit8284a4ba11e2d8ca55e3222e5730bfa8d6cca940 (patch)
tree710c4e6695d379698a9e40e308fbcce89fed0acf /libavformat/dv.c
parent6c0cf11f38f3306773401bf35174703cb4f12dd5 (diff)
downloadffmpeg-8284a4ba11e2d8ca55e3222e5730bfa8d6cca940.tar.gz
lavf/dv: use c->sys->frame_size in dv_frame_offset()
dv_frame_offset() is static and called only from dv_read_seek(), where c->sys->frame_size is already used. This simplifies the incoming codecpar merge where avctx->{coded_width,coded_height,time_base} are not accessible anymore.
Diffstat (limited to 'libavformat/dv.c')
-rw-r--r--libavformat/dv.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/libavformat/dv.c b/libavformat/dv.c
index 890f124668..b41d123996 100644
--- a/libavformat/dv.c
+++ b/libavformat/dv.c
@@ -418,13 +418,12 @@ static int64_t dv_frame_offset(AVFormatContext *s, DVDemuxContext *c,
int64_t timestamp, int flags)
{
// FIXME: sys may be wrong if last dv_read_packet() failed (buffer is junk)
- const AVDVProfile *sys = av_dv_codec_profile2(c->vst->codec->coded_width, c->vst->codec->coded_height,
- c->vst->codec->pix_fmt, c->vst->codec->time_base);
+ const int frame_size = c->sys->frame_size;
int64_t offset;
int64_t size = avio_size(s->pb) - s->internal->data_offset;
- int64_t max_offset = ((size - 1) / sys->frame_size) * sys->frame_size;
+ int64_t max_offset = ((size - 1) / frame_size) * frame_size;
- offset = sys->frame_size * timestamp;
+ offset = frame_size * timestamp;
if (size >= 0 && offset > max_offset)
offset = max_offset;