aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/dv.c
diff options
context:
space:
mode:
authorRoman Shaposhnik <roman@shaposhnik.org>2007-01-11 22:32:19 +0000
committerRoman Shaposhnik <roman@shaposhnik.org>2007-01-11 22:32:19 +0000
commit6eb2de748d0c0ac72ff2825a367fa58f1456189a (patch)
tree6922a1051914769bcba32c421e03f6f6033bf6d9 /libavformat/dv.c
parent3dd9fa77bfec7a2ced7a2af913a1db2ddcacf577 (diff)
downloadffmpeg-6eb2de748d0c0ac72ff2825a367fa58f1456189a.tar.gz
* Fixing seeking with DV-AVI (by Jeff Downs <heydowns at borg dot com>)
Originally committed as revision 7439 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/dv.c')
-rw-r--r--libavformat/dv.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libavformat/dv.c b/libavformat/dv.c
index 3ff8a3fe2f..10a3062601 100644
--- a/libavformat/dv.c
+++ b/libavformat/dv.c
@@ -358,8 +358,13 @@ static int64_t dv_frame_offset(AVFormatContext *s, DVDemuxContext *c,
return offset;
}
-void dv_flush_audio_packets(DVDemuxContext *c)
+void dv_offset_reset(DVDemuxContext *c, int64_t frame_offset)
{
+ c->frames= frame_offset;
+ if (c->ach)
+ c->abytes= av_rescale(c->frames,
+ c->ast[0]->codec->bit_rate * (int64_t)c->sys->frame_rate_base,
+ 8*c->sys->frame_rate);
c->audio_pkt[0].size = c->audio_pkt[1].size = 0;
}
@@ -419,13 +424,8 @@ static int dv_read_seek(AVFormatContext *s, int stream_index,
DVDemuxContext *c = r->dv_demux;
int64_t offset= dv_frame_offset(s, c, timestamp, flags);
- c->frames= offset / c->sys->frame_size;
- if (c->ach)
- c->abytes= av_rescale(c->frames,
- c->ast[0]->codec->bit_rate * (int64_t)c->sys->frame_rate_base,
- 8*c->sys->frame_rate);
+ dv_offset_reset(c, offset / c->sys->frame_size);
- dv_flush_audio_packets(c);
return url_fseek(&s->pb, offset, SEEK_SET);
}