]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/dv.c
Add forgotten avio-direct reference file.
[ffmpeg] / libavformat / dv.c
index 72f152d6b92fca82ec2722126954cdeadaa9a940..81a0e47adedc61f2da215b28d1c79efb5967a8bc 100644 (file)
@@ -323,13 +323,7 @@ DVDemuxContext* avpriv_dv_init_demux(AVFormatContext *s)
         return NULL;
     }
 
-    c->sys  = NULL;
-    c->fctx = s;
-    memset(c->ast, 0, sizeof(c->ast));
-    c->ach    = 0;
-    c->frames = 0;
-    c->abytes = 0;
-
+    c->fctx                   = s;
     c->vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
     c->vst->codec->codec_id   = CODEC_ID_DVVIDEO;
     c->vst->codec->bit_rate   = 25000000;
@@ -424,7 +418,7 @@ static int64_t dv_frame_offset(AVFormatContext *s, DVDemuxContext *c,
     return offset + s->data_offset;
 }
 
-void dv_offset_reset(DVDemuxContext *c, int64_t frame_offset)
+void ff_dv_offset_reset(DVDemuxContext *c, int64_t frame_offset)
 {
     c->frames= frame_offset;
     if (c->ach)
@@ -501,7 +495,7 @@ static int dv_read_header(AVFormatContext *s)
     }
     AV_WB32(c->buf, state);
 
-    if (avio_read(s->pb, c->buf + 4, DV_PROFILE_BYTES - 4) <= 0 ||
+    if (avio_read(s->pb, c->buf + 4, DV_PROFILE_BYTES - 4) != DV_PROFILE_BYTES - 4 ||
         avio_seek(s->pb, -DV_PROFILE_BYTES, SEEK_CUR) < 0)
         return AVERROR(EIO);
 
@@ -552,7 +546,7 @@ static int dv_read_seek(AVFormatContext *s, int stream_index,
     if (avio_seek(s->pb, offset, SEEK_SET) < 0)
         return -1;
 
-    dv_offset_reset(c, offset / c->sys->frame_size);
+    ff_dv_offset_reset(c, offset / c->sys->frame_size);
     return 0;
 }