[vlc-devel] [PATCH 4/9] tospidf: handle fmt->extended

Thomas Guillem thomas at gllm.fr
Thu Oct 3 16:33:54 CEST 2019


---
 modules/audio_filter/converter/tospdif.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/modules/audio_filter/converter/tospdif.c b/modules/audio_filter/converter/tospdif.c
index 5b11cace29..d40d62f1f2 100644
--- a/modules/audio_filter/converter/tospdif.c
+++ b/modules/audio_filter/converter/tospdif.c
@@ -543,6 +543,7 @@ static void Flush( filter_t *p_filter )
         case VLC_CODEC_TRUEHD:
             p_sys->truehd.i_frame_count = 0;
             break;
+        case VLC_CODEC_A52:
         case VLC_CODEC_EAC3:
             p_sys->eac3.i_nb_blocks = 0;
             break;
@@ -560,8 +561,13 @@ static block_t *DoWork( filter_t *p_filter, block_t *p_in_buf )
     switch( p_filter->fmt_in.audio.i_format )
     {
         case VLC_CODEC_A52:
-            i_ret = write_buffer_ac3( p_filter, p_in_buf );
-            break;
+            if (!p_filter->fmt_out.audio.extended)
+            {
+                i_ret = write_buffer_ac3( p_filter, p_in_buf );
+                break;
+            }
+            /* else AC-3 Core + EAC3 extension */
+            /* fall-through */
         case VLC_CODEC_EAC3:
             i_ret = write_buffer_eac3( p_filter, p_in_buf );
             break;
@@ -570,10 +576,7 @@ static block_t *DoWork( filter_t *p_filter, block_t *p_in_buf )
             i_ret = write_buffer_truehd( p_filter, p_in_buf );
             break;
         case VLC_CODEC_DTS:
-            /* if the fmt_out is configured for a higher rate than 48kHz
-             * (IEC958 rate), use the DTS-HD framing to pass the DTS Core and
-             * or DTS substreams (like DTS-HD MA). */
-            if( p_filter->fmt_out.audio.i_rate > 48000 )
+            if( p_filter->fmt_out.audio.extended )
                 i_ret = write_buffer_dtshd( p_filter, p_in_buf );
             else
                 i_ret = write_buffer_dts( p_filter, p_in_buf );
-- 
2.20.1



More information about the vlc-devel mailing list