*/
#include "avformat.h"
+#include "internal.h"
#include "riff.h"
#include "isom.h"
#include "matroska.h"
#include "avlanguage.h"
#include "libavutil/samplefmt.h"
#include "libavutil/intreadwrite.h"
-#include "libavutil/intfloat_readwrite.h"
+#include "libavutil/intfloat.h"
#include "libavutil/mathematics.h"
#include "libavutil/random_seed.h"
#include "libavutil/lfg.h"
{
put_ebml_id(pb, elementid);
put_ebml_num(pb, 8, 0);
- avio_wb64(pb, av_dbl2int(val));
+ avio_wb64(pb, av_double2int(val));
}
static void put_ebml_binary(AVIOContext *pb, unsigned int elementid,
currentpos = avio_tell(pb);
- if (seekhead->reserved_size > 0)
- if (avio_seek(pb, seekhead->filepos, SEEK_SET) < 0)
- return -1;
+ if (seekhead->reserved_size > 0) {
+ if (avio_seek(pb, seekhead->filepos, SEEK_SET) < 0) {
+ currentpos = -1;
+ goto fail;
+ }
+ }
metaseek = start_ebml_master(pb, MATROSKA_ID_SEEKHEAD, seekhead->reserved_size);
for (i = 0; i < seekhead->num_entries; i++) {
currentpos = seekhead->filepos;
}
+fail:
av_free(seekhead->entries);
av_free(seekhead);
{
MPEG4AudioConfig mp4ac;
- if (avpriv_mpeg4audio_get_config(&mp4ac, codec->extradata, codec->extradata_size) < 0) {
+ if (avpriv_mpeg4audio_get_config(&mp4ac, codec->extradata,
+ codec->extradata_size * 8, 1) < 0) {
av_log(s, AV_LOG_WARNING, "Error parsing AAC extradata, unable to determine samplerate.\n");
return;
}
end_ebml_master(pb, track);
// ms precision is the de-facto standard timescale for mkv files
- av_set_pts_info(st, 64, 1, 1000);
+ avpriv_set_pts_info(st, 64, 1, 1000);
}
end_ebml_master(pb, tracks);
return 0;