[vlc-devel] [PATCH] mp4: AC3/EAC3 are not packetized

Thomas Guillem thomas at gllm.fr
Tue Jul 12 13:38:32 CEST 2016


AC3 decoders need a ES format with valid channels, rate, bytes_per_frame and
frame_length that are not set from this demuxer.

---

This follow the conversion from "[RFC PATCH 0/9] audio decoder fallback: the
packetizer way".

Is it the correct way to ensure that a codec is packetized when it's needed ?
Shall I do that in others demuxers for others codecs ?

 modules/demux/mp4/essetup.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/modules/demux/mp4/essetup.c b/modules/demux/mp4/essetup.c
index a04cb04..e1c294f 100644
--- a/modules/demux/mp4/essetup.c
+++ b/modules/demux/mp4/essetup.c
@@ -108,9 +108,11 @@ static void SetupESDS( demux_t *p_demux, mp4_track_t *p_track, const MP4_descrip
         break;
     case( 0xa5 ):
         p_track->fmt.i_codec = VLC_CODEC_A52;
+        p_track->fmt.b_packetized = false;
         break;
     case( 0xa6 ):
         p_track->fmt.i_codec = VLC_CODEC_EAC3;
+        p_track->fmt.b_packetized = false;
         break;
     case( 0xa9 ): /* dts */
     case( 0xaa ): /* DTS-HD HRA */
@@ -809,6 +811,7 @@ int SetupAudioES( demux_t *p_demux, mp4_track_t *p_track, MP4_Box_t *p_sample )
                 p_track->fmt.i_bitrate = BOXDATA(p_dec3)->i_data_rate * 1000;
                 p_track->fmt.audio.i_bitspersample = 0;
             }
+            p_track->fmt.b_packetized = false;
             break;
         }
         case( ATOM_ac3 ):
@@ -831,6 +834,7 @@ int SetupAudioES( demux_t *p_demux, mp4_track_t *p_track, MP4_Box_t *p_sample )
                     p_track->fmt.i_bitrate = pi_bitrate[BOXDATA(p_dac3)->i_bitrate_code] * 1000;
                 p_track->fmt.audio.i_bitspersample = 0;
             }
+            p_track->fmt.b_packetized = false;
             break;
         }
 
-- 
2.8.1



More information about the vlc-devel mailing list