summaryrefslogtreecommitdiffstats
path: root/libmpdemux/stheader.h
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2010-11-21 14:52:08 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-11-21 14:52:08 +0200
commit37dbe7f5d07c8b1c4bb8529b87ddca7287ae8bae (patch)
tree91b8209605c657345d255b94a0833ba115ca9327 /libmpdemux/stheader.h
parent5a3edf4c0769c7e354ab6c9b0be3aa402254ff10 (diff)
downloadmpv-37dbe7f5d07c8b1c4bb8529b87ddca7287ae8bae.tar.bz2
mpv-37dbe7f5d07c8b1c4bb8529b87ddca7287ae8bae.tar.xz
demux_mkv, ad_ffmpeg: use Matroska OutputSamplingFrequency if available
Use the value of the OutputSamplingFrequency element instead of the SamplingFrequency element as the "container samplerate". In most cases this only removes a warning, as those typically differ for SBR AAC files and there was already a special case detecting this in ad_ffmpeg. The implementation adds a new "container_out_samplerate" field to the sh_audio struct. Reusing the existing "samplerate" field and the equivalent inside the 'wf' struct and just setting those to the new value instead would probably work (at least I'm not aware of any codec that would need the original SamplingFrequency for initialization). However using a separate field also avoids some ugliness: the 'wf' struct may not exist (though most demuxers create it), and the 'samplerate' field is overwritten to reflect the final value decided by codec when decoding is first initialized.
Diffstat (limited to 'libmpdemux/stheader.h')
-rw-r--r--libmpdemux/stheader.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/libmpdemux/stheader.h b/libmpdemux/stheader.h
index 35409188d5..4bb2da3ac7 100644
--- a/libmpdemux/stheader.h
+++ b/libmpdemux/stheader.h
@@ -55,6 +55,7 @@ typedef struct sh_audio {
// output format:
int sample_format;
int samplerate;
+ int container_out_samplerate;
int samplesize;
int channels;
int o_bps; // == samplerate*samplesize*channels (uncompr. bytes/sec)