From 899681cd1dbf4cd7c3b86af23bca25e20a54f4d0 Mon Sep 17 00:00:00 2001 From: Björn Axelsson Date: Wed, 21 Nov 2007 07:41:00 +0000 Subject: Use dynamically allocated ByteIOContext in AVFormatContext MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit patch by: Björn Axelsson, bjorn d axelsson a intinor d se thread: [PATCH] Remove static ByteIOContexts, 06 nov 2007 Originally committed as revision 11071 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/yuv4mpeg.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libavformat/yuv4mpeg.c') diff --git a/libavformat/yuv4mpeg.c b/libavformat/yuv4mpeg.c index 9614894caf..7913e417a7 100644 --- a/libavformat/yuv4mpeg.c +++ b/libavformat/yuv4mpeg.c @@ -87,7 +87,7 @@ static int yuv4_generate_header(AVFormatContext *s, char* buf) 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 @@ static int yuv4_read_header(AVFormatContext *s, AVFormatParameters *ap) 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 @@ static int yuv4_read_packet(AVFormatContext *s, AVPacket *pkt) struct frame_attributes *s1 = s->priv_data; for (i=0; ipb); + header[i] = get_byte(s->pb); if (header[i] == '\n') { header[i+1] = 0; break; @@ -360,7 +360,7 @@ static int yuv4_read_packet(AVFormatContext *s, AVPacket *pkt) 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) { -- cgit v1.2.3