Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions include/libmkv.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ extern "C" {
#define MK_SUBTITLE_USF "S_TEXT/USF"
#define MK_SUBTITLE_VOBSUB "S_VOBSUB"
#define MK_SUBTITLE_BMP "S_IMAGE/BMP"
#define MK_SUBTITLE_PGS "S_HDMV/PGS"

/* Official Tags */
#define MK_TAG_TITLE "TITLE"
Expand Down Expand Up @@ -203,6 +204,7 @@ struct mk_TrackConfig_s {
} video;
struct {
float samplingFreq; /* Sampling Frequency in Hz */
float outputSamplingFreq; /* Playback Sampling Frequency in Hz (e.g. for AAC w/SBR) */
unsigned channels; /* Number of channels for this track */
unsigned bitDepth; /* Bits per sample (PCM) */
} audio;
Expand Down
7 changes: 6 additions & 1 deletion src/matroska.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,19 @@

#include <sys/time.h>

#if defined( __MINGW32__ )
#undef fseeko
#define fseeko fseeko64
#endif

#define RESERVED_SEEKHEAD 0x100
/* 256 bytes should be enough room for our Seek entries. */
#define RESERVED_CHAPTERS 0x1000
/* 4096 bytes, hopefully enough for Chapters. */

int mk_seekFile(mk_Writer *w, uint64_t pos)
{
if (fseek(w->fp, pos, SEEK_SET))
if (fseeko(w->fp, pos, SEEK_SET))
return -1;

w->f_pos = pos;
Expand Down
5 changes: 5 additions & 0 deletions src/tracks.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,11 @@ mk_Track *mk_createTrack(mk_Writer *w, mk_TrackConfig *tc)
/* SamplingFrequency */
if (mk_writeFloat(v, MATROSKA_ID_AUDIOSAMPLINGFREQ, tc->extra.audio.samplingFreq) < 0)
return NULL;
if (tc->extra.audio.outputSamplingFreq) {
/* Output SamplingFrequency */
if (mk_writeFloat(v, MATROSKA_ID_AUDIOOUTSAMPLINGFREQ, tc->extra.audio.outputSamplingFreq) < 0)
return NULL;
}
/* Channels */
if (mk_writeUInt(v, MATROSKA_ID_AUDIOCHANNELS, tc->extra.audio.channels) < 0)
return NULL;
Expand Down