[vlc-commits] wasapi: set i_bytes_per_frame for S/PDIF

Thomas Guillem git at videolan.org
Fri Oct 7 12:10:17 CEST 2016


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Oct  6 16:40:29 2016 +0200| [d7341fdca4ec97bd75db97ebf491e5dbaeca6743] | committer: Thomas Guillem

wasapi: set i_bytes_per_frame for S/PDIF

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d7341fdca4ec97bd75db97ebf491e5dbaeca6743
---

 modules/audio_output/wasapi.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/modules/audio_output/wasapi.c b/modules/audio_output/wasapi.c
index a90d2da..93303e2 100644
--- a/modules/audio_output/wasapi.c
+++ b/modules/audio_output/wasapi.c
@@ -280,12 +280,13 @@ static void vlc_HdmiToWave(WAVEFORMATEXTENSIBLE_IEC61937 *restrict wf_iec61937,
     wf_iec61937->dwAverageBytesPerSec = 0;
 
     audio->i_format = VLC_CODEC_SPDIFL;
+    audio->i_bytes_per_frame = wf->Format.nBlockAlign;
+    audio->i_frame_length = 1;
 }
 
 static void vlc_SpdifToWave(WAVEFORMATEXTENSIBLE *restrict wf,
                             audio_sample_format_t *restrict audio)
 {
-
     switch (audio->i_format)
     {
     case VLC_CODEC_DTS:
@@ -299,7 +300,6 @@ static void vlc_SpdifToWave(WAVEFORMATEXTENSIBLE *restrict wf,
     default:
         vlc_assert_unreachable();
     }
-    audio->i_format = VLC_CODEC_SPDIFL;
 
     wf->Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE;
     wf->Format.nChannels = 2; /* To prevent channel re-ordering */
@@ -312,6 +312,10 @@ static void vlc_SpdifToWave(WAVEFORMATEXTENSIBLE *restrict wf,
     wf->Samples.wValidBitsPerSample = wf->Format.wBitsPerSample;
 
     wf->dwChannelMask = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT;
+
+    audio->i_format = VLC_CODEC_SPDIFL;
+    audio->i_bytes_per_frame = wf->Format.nBlockAlign;
+    audio->i_frame_length = 1;
 }
 
 static void vlc_ToWave(WAVEFORMATEXTENSIBLE *restrict wf,



More information about the vlc-commits mailing list