diff dv.c @ 2771:d52c718e83f9 libavformat

Use dynamically allocated ByteIOContext in AVFormatContext patch by: Bj?rn Axelsson, bjorn d axelsson a intinor d se thread: [PATCH] Remove static ByteIOContexts, 06 nov 2007
author andoma
date Wed, 21 Nov 2007 07:41:00 +0000
parents b21c2af60bc9
children 1de87c1b6a12
line wrap: on
line diff
--- a/dv.c	Mon Nov 19 20:28:11 2007 +0000
+++ b/dv.c	Wed Nov 21 07:41:00 2007 +0000
@@ -347,7 +347,7 @@
     // FIXME: sys may be wrong if last dv_read_packet() failed (buffer is junk)
     const DVprofile* sys = dv_codec_profile(c->vst->codec);
     int64_t offset;
-    int64_t size = url_fsize(&s->pb);
+    int64_t size = url_fsize(s->pb);
     int64_t max_offset = ((size-1) / sys->frame_size) * sys->frame_size;
 
     offset = sys->frame_size * timestamp;
@@ -386,8 +386,8 @@
     if (!c->dv_demux)
         return -1;
 
-    if (get_buffer(&s->pb, c->buf, DV_PROFILE_BYTES) <= 0 ||
-        url_fseek(&s->pb, -DV_PROFILE_BYTES, SEEK_CUR) < 0)
+    if (get_buffer(s->pb, c->buf, DV_PROFILE_BYTES) <= 0 ||
+        url_fseek(s->pb, -DV_PROFILE_BYTES, SEEK_CUR) < 0)
         return AVERROR(EIO);
 
     c->dv_demux->sys = dv_frame_profile(c->buf);
@@ -408,7 +408,7 @@
 
     if (size < 0) {
         size = c->dv_demux->sys->frame_size;
-        if (get_buffer(&s->pb, c->buf, size) <= 0)
+        if (get_buffer(s->pb, c->buf, size) <= 0)
             return AVERROR(EIO);
 
         size = dv_produce_packet(c->dv_demux, pkt, c->buf, size);
@@ -426,7 +426,7 @@
 
     dv_offset_reset(c, offset / c->sys->frame_size);
 
-    offset = url_fseek(&s->pb, offset, SEEK_SET);
+    offset = url_fseek(s->pb, offset, SEEK_SET);
     return (offset < 0)?offset:0;
 }