From 4647c0ec663be8e0960437381ca66cf7e7d1d8e1 Mon Sep 17 00:00:00 2001 From: Aurelien Jacobs Date: Wed, 8 Nov 2006 20:09:56 +0000 Subject: [PATCH] add audio output sampling freqency reading in matroska Originally committed as revision 6946 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/matroska.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/libavformat/matroska.c b/libavformat/matroska.c index e4763f3848..4917388a1c 100644 --- a/libavformat/matroska.c +++ b/libavformat/matroska.c @@ -110,6 +110,8 @@ /* IDs in the trackaudio master */ #define MATROSKA_ID_AUDIOSAMPLINGFREQ 0xB5 +#define MATROSKA_ID_AUDIOOUTSAMPLINGFREQ 0x78B5 + #define MATROSKA_ID_AUDIOBITDEPTH 0x6264 #define MATROSKA_ID_AUDIOCHANNELS 0x9F @@ -273,6 +275,7 @@ typedef struct MatroskaAudioTrack { int channels, bitdepth, + internal_samplerate, samplerate; //.. } MatroskaAudioTrack; @@ -1429,6 +1432,16 @@ matroska_add_stream (MatroskaDemuxContext *matroska) switch (id) { /* samplerate */ case MATROSKA_ID_AUDIOSAMPLINGFREQ: { + double num; + if ((res = ebml_read_float(matroska, &id, + &num)) < 0) + break; + audiotrack->internal_samplerate = + audiotrack->samplerate = num; + break; + } + + case MATROSKA_ID_AUDIOOUTSAMPLINGFREQ: { double num; if ((res = ebml_read_float(matroska, &id, &num)) < 0)