diff options
author | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2008-03-01 03:05:13 +0100 |
---|---|---|
committer | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2008-03-01 03:05:13 +0100 |
commit | 1d0b3b20c34517b9d1ddf3ea347776304b0c4b44 (patch) | |
tree | 89f4fc640c2becc6f00ae08996754952ecf149c1 /contrib/ffmpeg/libavformat/wav.c | |
parent | 09496ad3469a0ade8dbd9a351e639b78f20b7942 (diff) | |
download | xine-lib-1d0b3b20c34517b9d1ddf3ea347776304b0c4b44.tar.gz xine-lib-1d0b3b20c34517b9d1ddf3ea347776304b0c4b44.tar.bz2 |
Update internal FFmpeg copy.
Diffstat (limited to 'contrib/ffmpeg/libavformat/wav.c')
-rw-r--r-- | contrib/ffmpeg/libavformat/wav.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/contrib/ffmpeg/libavformat/wav.c b/contrib/ffmpeg/libavformat/wav.c index 0699bec70..5053d1500 100644 --- a/contrib/ffmpeg/libavformat/wav.c +++ b/contrib/ffmpeg/libavformat/wav.c @@ -19,7 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "avformat.h" -#include "allformats.h" +#include "raw.h" #include "riff.h" typedef struct { @@ -34,7 +34,7 @@ typedef struct { static int wav_write_header(AVFormatContext *s) { WAVContext *wav = s->priv_data; - ByteIOContext *pb = &s->pb; + ByteIOContext *pb = s->pb; offset_t fmt, fact; put_tag(pb, "RIFF"); @@ -50,7 +50,7 @@ static int wav_write_header(AVFormatContext *s) end_tag(pb, fmt); if(s->streams[0]->codec->codec_tag != 0x01 /* hence for all other than PCM */ - && !url_is_streamed(&s->pb)) { + && !url_is_streamed(s->pb)) { fact = start_tag(pb, "fact"); put_le32(pb, 0); end_tag(pb, fact); @@ -70,7 +70,7 @@ static int wav_write_header(AVFormatContext *s) static int wav_write_packet(AVFormatContext *s, AVPacket *pkt) { - ByteIOContext *pb = &s->pb; + ByteIOContext *pb = s->pb; WAVContext *wav = s->priv_data; put_buffer(pb, pkt->data, pkt->size); if(pkt->pts != AV_NOPTS_VALUE) { @@ -84,11 +84,11 @@ static int wav_write_packet(AVFormatContext *s, AVPacket *pkt) static int wav_write_trailer(AVFormatContext *s) { - ByteIOContext *pb = &s->pb; + ByteIOContext *pb = s->pb; WAVContext *wav = s->priv_data; offset_t file_size; - if (!url_is_streamed(&s->pb)) { + if (!url_is_streamed(s->pb)) { end_tag(pb, wav->data); /* update file size */ @@ -156,7 +156,7 @@ static int wav_read_header(AVFormatContext *s, { int size; unsigned int tag; - ByteIOContext *pb = &s->pb; + ByteIOContext *pb = s->pb; AVStream *st; WAVContext *wav = s->priv_data; @@ -176,10 +176,10 @@ static int wav_read_header(AVFormatContext *s, return -1; st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); get_wav_header(pb, st->codec, size); - st->need_parsing = 1; + st->need_parsing = AVSTREAM_PARSE_FULL; av_set_pts_info(st, 64, 1, st->codec->sample_rate); @@ -199,17 +199,17 @@ static int wav_read_packet(AVFormatContext *s, AVStream *st; WAVContext *wav = s->priv_data; - if (url_feof(&s->pb)) - return AVERROR_IO; + if (url_feof(s->pb)) + return AVERROR(EIO); st = s->streams[0]; - left= wav->data_end - url_ftell(&s->pb); + left= wav->data_end - url_ftell(s->pb); if(left <= 0){ - left = find_tag(&(s->pb), MKTAG('d', 'a', 't', 'a')); + left = find_tag(s->pb, MKTAG('d', 'a', 't', 'a')); if (left < 0) { - return AVERROR_IO; + return AVERROR(EIO); } - wav->data_end= url_ftell(&s->pb) + left; + wav->data_end= url_ftell(s->pb) + left; } size = MAX_SIZE; @@ -219,9 +219,9 @@ static int wav_read_packet(AVFormatContext *s, size = (size / st->codec->block_align) * st->codec->block_align; } size= FFMIN(size, left); - ret= av_get_packet(&s->pb, pkt, size); + ret= av_get_packet(s->pb, pkt, size); if (ret <= 0) - return AVERROR_IO; + return AVERROR(EIO); pkt->stream_index = 0; /* note: we need to modify the packet size here to handle the last |