diff yuv4mpeg.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 2d7d35d04f9c
line wrap: on
line diff
--- a/yuv4mpeg.c	Mon Nov 19 20:28:11 2007 +0000
+++ b/yuv4mpeg.c	Wed Nov 21 07:41:00 2007 +0000
@@ -87,7 +87,7 @@
 static int yuv4_write_packet(AVFormatContext *s, AVPacket *pkt)
 {
     AVStream *st = s->streams[pkt->stream_index];
-    ByteIOContext *pb = &s->pb;
+    ByteIOContext *pb = s->pb;
     AVPicture *picture;
     int* first_pkt = s->priv_data;
     int width, height, h_chroma_shift, v_chroma_shift;
@@ -190,7 +190,7 @@
     char header[MAX_YUV4_HEADER+10];  // Include headroom for the longest option
     char *tokstart,*tokend,*header_end;
     int i;
-    ByteIOContext *pb = &s->pb;
+    ByteIOContext *pb = s->pb;
     int width=-1, height=-1, raten=0, rated=0, aspectn=0, aspectd=0;
     enum PixelFormat pix_fmt=PIX_FMT_NONE,alt_pix_fmt=PIX_FMT_NONE;
     AVStream *st;
@@ -344,7 +344,7 @@
     struct frame_attributes *s1 = s->priv_data;
 
     for (i=0; i<MAX_FRAME_HEADER; i++) {
-        header[i] = get_byte(&s->pb);
+        header[i] = get_byte(s->pb);
         if (header[i] == '\n') {
             header[i+1] = 0;
             break;
@@ -360,7 +360,7 @@
     if (packet_size < 0)
         return -1;
 
-    if (av_get_packet(&s->pb, pkt, packet_size) != packet_size)
+    if (av_get_packet(s->pb, pkt, packet_size) != packet_size)
         return AVERROR(EIO);
 
     if (s->streams[0]->codec->coded_frame) {