*/
/**
- * @file westwood.c
+ * @file libavformat/westwood.c
* Westwood Studios VQA & AUD file demuxers
* by Mike Melanson (melanson@pcisys.net)
* for more information on the Westwood file formats, visit:
* qualify a file. Refer to wsaud_probe() for the precise parameters.
*/
+#include "libavutil/intreadwrite.h"
#include "avformat.h"
#define AUD_HEADER_SIZE 12
#define VQA_HEADER_SIZE 0x2A
#define VQA_FRAMERATE 15
-#define VQA_VIDEO_PTS_INC (90000 / VQA_FRAMERATE)
#define VQA_PREAMBLE_SIZE 8
typedef struct WsAudDemuxContext {
int audio_samplerate;
int audio_channels;
int audio_bits;
- int audio_type;
+ enum CodecID audio_type;
int audio_stream_index;
int64_t audio_frame_counter;
} WsAudDemuxContext;
int video_stream_index;
int64_t audio_frame_counter;
- int64_t video_pts;
} WsVqaDemuxContext;
static int wsaud_probe(AVProbeData *p)
url_fseek(pb, chunk_size, SEEK_CUR);
} while (chunk_tag != FINF_TAG);
- wsvqa->video_pts = wsvqa->audio_frame_counter = 0;
-
return 0;
}
wsvqa->audio_frame_counter += AV_RL16(pkt->data) / wsvqa->audio_channels;
} else {
pkt->stream_index = wsvqa->video_stream_index;
- wsvqa->video_pts += VQA_VIDEO_PTS_INC;
}
/* stay on 16-bit alignment */
if (skip_byte)
return ret;
}
-#ifdef CONFIG_WSAUD_DEMUXER
+#if CONFIG_WSAUD_DEMUXER
AVInputFormat wsaud_demuxer = {
"wsaud",
NULL_IF_CONFIG_SMALL("Westwood Studios audio format"),
wsaud_read_packet,
};
#endif
-#ifdef CONFIG_WSVQA_DEMUXER
+#if CONFIG_WSVQA_DEMUXER
AVInputFormat wsvqa_demuxer = {
"wsvqa",
NULL_IF_CONFIG_SMALL("Westwood Studios VQA format"),