#include "avformat.h"
/* For codec_get_bmp_id and codec_get_wav_id. */
-#include "avi.h"
+#include "riff.h"
#include "intfloat_readwrite.h"
/* EBML version supported */
*/
typedef struct CodecTags{
- char *str;
+ const char *str;
enum CodecID id;
}CodecTags;
#define MATROSKA_CODEC_ID_VIDEO_VFW_FOURCC "V_MS/VFW/FOURCC"
#define MATROSKA_CODEC_ID_AUDIO_ACM "A_MS/ACM"
-CodecTags codec_tags[]={
+static CodecTags codec_tags[]={
// {"V_MS/VFW/FOURCC" , CODEC_ID_NONE},
{"V_UNCOMPRESSED" , CODEC_ID_RAWVIDEO},
{"V_MPEG4/ISO/SP" , CODEC_ID_MPEG4},
if (res == 0) {
for (n = 0; n < laces; n++) {
- uint64_t timecode = 0;
+ uint64_t timecode = AV_NOPTS_VALUE;
pkt = av_mallocz(sizeof(AVPacket));
/* XXX: prevent data copy... */
res = AVERROR_NOMEM;
break;
}
- if (cluster_time != (uint64_t)-1) {
- if (block_time < 0 && (-block_time) > cluster_time)
- timecode = cluster_time;
- else
+ if (cluster_time != (uint64_t)-1 && n == 0) {
+ if (cluster_time + block_time >= 0)
timecode = cluster_time + block_time;
}
/* FIXME: duration */
av_free(track);
}
- for (n = 0; n < s->nb_streams; n++) {
- av_free(s->streams[n]->codec->extradata);
- }
-
memset(matroska, 0, sizeof(MatroskaDemuxContext));
return 0;
}
-static AVInputFormat matroska_iformat = {
+AVInputFormat matroska_demuxer = {
"matroska",
"Matroska file format",
sizeof(MatroskaDemuxContext),
matroska_read_packet,
matroska_read_close,
};
-
-int
-matroska_init(void)
-{
- av_register_input_format(&matroska_iformat);
- return 0;
-}