diff options
author | Björn Axelsson <gecko@acc.umu.se> | 2007-11-21 07:41:00 +0000 |
---|---|---|
committer | Andreas Öman <andreas@lonelycoder.com> | 2007-11-21 07:41:00 +0000 |
commit | 899681cd1dbf4cd7c3b86af23bca25e20a54f4d0 (patch) | |
tree | 6f4556497efab1d703d1289b170c936154c6bbd5 /libavformat/img2.c | |
parent | 79815f622d90499f882ad968a1351134535cbbab (diff) | |
download | ffmpeg-streaming-899681cd1dbf4cd7c3b86af23bca25e20a54f4d0.zip ffmpeg-streaming-899681cd1dbf4cd7c3b86af23bca25e20a54f4d0.tar.gz |
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
Originally committed as revision 11071 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/img2.c')
-rw-r--r-- | libavformat/img2.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libavformat/img2.c b/libavformat/img2.c index af17040..42a2d61 100644 --- a/libavformat/img2.c +++ b/libavformat/img2.c @@ -239,7 +239,7 @@ static int img_read_packet(AVFormatContext *s1, AVPacket *pkt) char filename[1024]; int i; int size[3]={0}, ret[3]={0}; - ByteIOContext f1[3], *f[3]= {&f1[0], &f1[1], &f1[2]}; + ByteIOContext *f[3]; AVCodecContext *codec= s1->streams[0]->codec; if (!s->is_pipe) { @@ -251,7 +251,7 @@ static int img_read_packet(AVFormatContext *s1, AVPacket *pkt) s->path, s->img_number)<0 && s->img_number > 1) return AVERROR(EIO); for(i=0; i<3; i++){ - if (url_fopen(f[i], filename, URL_RDONLY) < 0) + if (url_fopen(&f[i], filename, URL_RDONLY) < 0) return AVERROR(EIO); size[i]= url_fsize(f[i]); @@ -263,7 +263,7 @@ static int img_read_packet(AVFormatContext *s1, AVPacket *pkt) if(codec->codec_id == CODEC_ID_RAWVIDEO && !codec->width) infer_size(&codec->width, &codec->height, size[0]); } else { - f[0] = &s1->pb; + f[0] = s1->pb; if (url_feof(f[0])) return AVERROR(EIO); size[0]= 4096; @@ -322,7 +322,7 @@ static int img_write_header(AVFormatContext *s) static int img_write_packet(AVFormatContext *s, AVPacket *pkt) { VideoData *img = s->priv_data; - ByteIOContext pb1[3], *pb[3]= {&pb1[0], &pb1[1], &pb1[2]}; + ByteIOContext *pb[3]; char filename[1024]; AVCodecContext *codec= s->streams[ pkt->stream_index ]->codec; int i; @@ -332,7 +332,7 @@ static int img_write_packet(AVFormatContext *s, AVPacket *pkt) img->path, img->img_number) < 0 && img->img_number>1) return AVERROR(EIO); for(i=0; i<3; i++){ - if (url_fopen(pb[i], filename, URL_WRONLY) < 0) + if (url_fopen(&pb[i], filename, URL_WRONLY) < 0) return AVERROR(EIO); if(codec->codec_id != CODEC_ID_RAWVIDEO) @@ -340,7 +340,7 @@ static int img_write_packet(AVFormatContext *s, AVPacket *pkt) filename[ strlen(filename) - 1 ]= 'U' + i; } } else { - pb[0] = &s->pb; + pb[0] = s->pb; } if(codec->codec_id == CODEC_ID_RAWVIDEO){ |