summaryrefslogtreecommitdiffstats
path: root/stream/stream_bluray.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-11-23 21:42:31 +0100
committerwm4 <wm4@nowhere>2013-11-23 21:42:31 +0100
commite901bb7c99e22e9986a62fc721757cb30ac7ceb9 (patch)
tree42d7214df70323cc619991c6b24078fb521592f8 /stream/stream_bluray.c
parentf90e7ef7eafa0d5b1933f93bb116011cf1cb74b1 (diff)
downloadmpv-e901bb7c99e22e9986a62fc721757cb30ac7ceb9.tar.bz2
mpv-e901bb7c99e22e9986a62fc721757cb30ac7ceb9.tar.xz
audio: respect --end/--length with spdif passthrough
In theory, we can't really do this, because we don't know when a spdif frame ends. Spdif transports compressed audio through audio setups that were originally designed for PCM only (which includes the audio filter chain, the AO API, most audio output APIs, etc.), and to reach this goal, spdif pretends to be PCM. Compressed data frames are padded with zeros, until a certain data rate is reached, which corresponds to a pseudo-PCM format with 2 bytes per sample and 2 channels at 48000 Hz. Of course an actual spdif frame is significantly larger than a frame of the PCM format it pretends to be, so cutting audio data on frame boundaries (as according to the pseudo-PCM format) merely yields an incomplete and broken frame, not audio that plays for the desired duration. However, sending an incomplete frame might still be much better than the current behavior, which simply ignores --end/--length (but still lets the video end at the exact end time). Should this result in trouble with real spdif receivers, this commit probably has to be reverted.
Diffstat (limited to 'stream/stream_bluray.c')
0 files changed, 0 insertions, 0 deletions