* 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 {
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");
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);
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) {
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 */
p->buf[2] == 'F' && p->buf[3] == 'F' &&
p->buf[8] == 'W' && p->buf[9] == 'A' &&
p->buf[10] == 'V' && p->buf[11] == 'E')
- return AVPROBE_SCORE_MAX;
+ /*
+ Since ACT demuxer has standard WAV header at top of it's own,
+ returning score is decreased to avoid probe conflict
+ between ACT and WAV.
+ */
+ return AVPROBE_SCORE_MAX - 1;
else
return 0;
}
{
int size;
unsigned int tag;
- ByteIOContext *pb = &s->pb;
+ ByteIOContext *pb = s->pb;
AVStream *st;
WAVContext *wav = s->priv_data;
AVStream *st;
WAVContext *wav = s->priv_data;
- if (url_feof(&s->pb))
+ 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(EIO);
}
- wav->data_end= url_ftell(&s->pb) + left;
+ wav->data_end= url_ftell(s->pb) + left;
}
size = MAX_SIZE;
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(EIO);
pkt->stream_index = 0;