+ /* Registration Descriptor */
+ if( p_dr->i_length != 4 )
+ {
+ msg_Warn( p_demux, "invalid Registration Descriptor" );
+ }
+ else
+ {
+ if( !memcmp( p_dr->p_data, "AC-3", 4 ) )
+ {
+ /* ATSC with stream_type 0x81 (but this descriptor
+ * is then not mandatory */
+ pid->es->fmt.i_cat = AUDIO_ES;
+ pid->es->fmt.i_codec = VLC_FOURCC('a','5','2',' ');
+ }
+ else if( !memcmp( p_dr->p_data, "DTS1", 4 ) ||
+ !memcmp( p_dr->p_data, "DTS2", 4 ) ||
+ !memcmp( p_dr->p_data, "DTS3", 4 ) )
+ {
+ /*registration descriptor(ETSI TS 101 154 Annex F)*/
+ pid->es->fmt.i_cat = AUDIO_ES;
+ pid->es->fmt.i_codec = VLC_FOURCC('d','t','s',' ');
+ }
+ else if( !memcmp( p_dr->p_data, "BSSD", 4 ) )
+ {
+ pid->es->fmt.i_cat = AUDIO_ES;
+ pid->es->fmt.i_codec = VLC_FOURCC('l','p','c','m');
+ }
+ else
+ {
+ msg_Warn( p_demux,
+ "unknown Registration Descriptor (%4.4s)",
+ p_dr->p_data );
+ }
+ }
+