Mercurial > libavformat.hg
comparison au.c @ 65:a58a8a53eb46 libavformat
* UINTX -> uintx_t INTX -> intx_t
author | kabi |
---|---|
date | Tue, 11 Feb 2003 16:35:48 +0000 |
parents | 39c4c4336486 |
children | 2fa5e94ba716 |
comparison
equal
deleted
inserted
replaced
64:b0e0eb595e29 | 65:a58a8a53eb46 |
---|---|
27 | 27 |
28 #include "avformat.h" | 28 #include "avformat.h" |
29 #include "avi.h" | 29 #include "avi.h" |
30 | 30 |
31 /* if we don't know the size in advance */ | 31 /* if we don't know the size in advance */ |
32 #define AU_UNKOWN_SIZE ((UINT32)(~0)) | 32 #define AU_UNKOWN_SIZE ((uint32_t)(~0)) |
33 | 33 |
34 /* The ffmpeg codecs we support, and the IDs they have in the file */ | 34 /* The ffmpeg codecs we support, and the IDs they have in the file */ |
35 static const CodecTag codec_au_tags[] = { | 35 static const CodecTag codec_au_tags[] = { |
36 { CODEC_ID_PCM_MULAW, 1 }, | 36 { CODEC_ID_PCM_MULAW, 1 }, |
37 { CODEC_ID_PCM_S16BE, 3 }, | 37 { CODEC_ID_PCM_S16BE, 3 }, |
48 if (tag == 0) | 48 if (tag == 0) |
49 return -1; | 49 return -1; |
50 put_tag(pb, ".snd"); /* magic number */ | 50 put_tag(pb, ".snd"); /* magic number */ |
51 put_be32(pb, 24); /* header size */ | 51 put_be32(pb, 24); /* header size */ |
52 put_be32(pb, AU_UNKOWN_SIZE); /* data size */ | 52 put_be32(pb, AU_UNKOWN_SIZE); /* data size */ |
53 put_be32(pb, (UINT32)tag); /* codec ID */ | 53 put_be32(pb, (uint32_t)tag); /* codec ID */ |
54 put_be32(pb, enc->sample_rate); | 54 put_be32(pb, enc->sample_rate); |
55 put_be32(pb, (UINT32)enc->channels); | 55 put_be32(pb, (uint32_t)enc->channels); |
56 return 0; | 56 return 0; |
57 } | 57 } |
58 | 58 |
59 static int au_write_header(AVFormatContext *s) | 59 static int au_write_header(AVFormatContext *s) |
60 { | 60 { |
71 | 71 |
72 return 0; | 72 return 0; |
73 } | 73 } |
74 | 74 |
75 static int au_write_packet(AVFormatContext *s, int stream_index_ptr, | 75 static int au_write_packet(AVFormatContext *s, int stream_index_ptr, |
76 UINT8 *buf, int size, int force_pts) | 76 uint8_t *buf, int size, int force_pts) |
77 { | 77 { |
78 ByteIOContext *pb = &s->pb; | 78 ByteIOContext *pb = &s->pb; |
79 put_buffer(pb, buf, size); | 79 put_buffer(pb, buf, size); |
80 return 0; | 80 return 0; |
81 } | 81 } |
88 if (!url_is_streamed(&s->pb)) { | 88 if (!url_is_streamed(&s->pb)) { |
89 | 89 |
90 /* update file size */ | 90 /* update file size */ |
91 file_size = url_ftell(pb); | 91 file_size = url_ftell(pb); |
92 url_fseek(pb, 8, SEEK_SET); | 92 url_fseek(pb, 8, SEEK_SET); |
93 put_be32(pb, (UINT32)(file_size - 24)); | 93 put_be32(pb, (uint32_t)(file_size - 24)); |
94 url_fseek(pb, file_size, SEEK_SET); | 94 url_fseek(pb, file_size, SEEK_SET); |
95 | 95 |
96 put_flush_packet(pb); | 96 put_flush_packet(pb); |
97 } | 97 } |
98 | 98 |