aboutsummaryrefslogtreecommitdiffstats
path: root/libav
diff options
context:
space:
mode:
authorFabrice Bellard <fabrice@bellard.org>2002-05-18 23:09:43 +0000
committerFabrice Bellard <fabrice@bellard.org>2002-05-18 23:09:43 +0000
commit065422677a17ddb3d84a3b85b5064eb7df7e2c8a (patch)
tree9c444bf60f6633ab326ff8ab4dc3d98b741f681f /libav
parentf57a4535bdc45390b9a6c14b8b6d0c32dffa723d (diff)
downloadffmpeg-065422677a17ddb3d84a3b85b5064eb7df7e2c8a.tar.gz
fixed pcm read
Originally committed as revision 527 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libav')
-rw-r--r--libav/raw.c42
1 files changed, 11 insertions, 31 deletions
diff --git a/libav/raw.c b/libav/raw.c
index a2da4d1a7e..5608287e65 100644
--- a/libav/raw.c
+++ b/libav/raw.c
@@ -44,7 +44,7 @@ static int raw_read_header(AVFormatContext *s,
{
AVStream *st;
- st = malloc(sizeof(AVStream));
+ st = av_malloc(sizeof(AVStream));
if (!st)
return -1;
s->nb_streams = 1;
@@ -60,7 +60,7 @@ static int raw_read_header(AVFormatContext *s,
st->codec.codec_type = CODEC_TYPE_VIDEO;
st->codec.codec_id = s->format->video_codec;
} else {
- free(st);
+ av_free(st);
return -1;
}
@@ -83,26 +83,6 @@ static int raw_read_header(AVFormatContext *s,
return 0;
}
-/* raw input */
-static int pcm_read_header(AVFormatContext *s,
- AVFormatParameters *ap)
-{
- AVStream *st;
-
- st = malloc(sizeof(AVStream));
- if (!st)
- return -1;
- s->nb_streams = 1;
- s->streams[0] = st;
-
- st->id = 0;
-
- st->codec.codec_type = CODEC_TYPE_AUDIO;
- st->codec.codec_id = s->format->audio_codec;
-
- return 0;
-}
-
#define RAW_PACKET_SIZE 1024
int raw_read_packet(AVFormatContext *s,
@@ -136,7 +116,7 @@ static int mp3_read_header(AVFormatContext *s,
{
AVStream *st;
- st = malloc(sizeof(AVStream));
+ st = av_malloc(sizeof(AVStream));
if (!st)
return -1;
s->nb_streams = 1;
@@ -268,7 +248,7 @@ AVFormat pcm_s16le_format = {
raw_write_packet,
raw_write_trailer,
- pcm_read_header,
+ raw_read_header,
raw_read_packet,
raw_read_close,
};
@@ -288,7 +268,7 @@ AVFormat pcm_s16be_format = {
raw_write_packet,
raw_write_trailer,
- pcm_read_header,
+ raw_read_header,
raw_read_packet,
raw_read_close,
};
@@ -308,7 +288,7 @@ AVFormat pcm_u16le_format = {
raw_write_packet,
raw_write_trailer,
- pcm_read_header,
+ raw_read_header,
raw_read_packet,
raw_read_close,
};
@@ -328,7 +308,7 @@ AVFormat pcm_u16be_format = {
raw_write_packet,
raw_write_trailer,
- pcm_read_header,
+ raw_read_header,
raw_read_packet,
raw_read_close,
};
@@ -344,7 +324,7 @@ AVFormat pcm_s8_format = {
raw_write_packet,
raw_write_trailer,
- pcm_read_header,
+ raw_read_header,
raw_read_packet,
raw_read_close,
};
@@ -360,7 +340,7 @@ AVFormat pcm_u8_format = {
raw_write_packet,
raw_write_trailer,
- pcm_read_header,
+ raw_read_header,
raw_read_packet,
raw_read_close,
};
@@ -376,7 +356,7 @@ AVFormat pcm_mulaw_format = {
raw_write_packet,
raw_write_trailer,
- pcm_read_header,
+ raw_read_header,
raw_read_packet,
raw_read_close,
};
@@ -392,7 +372,7 @@ AVFormat pcm_alaw_format = {
raw_write_packet,
raw_write_trailer,
- pcm_read_header,
+ raw_read_header,
raw_read_packet,
raw_read_close,
};