/*****************************************************************************
* Preamble
*****************************************************************************/
-#include <stdlib.h>
#include <vlc/vlc.h>
-#include <vlc/input.h>
-#include <vlc/sout.h>
+#include <vlc_sout.h>
+#include <vlc_codecs.h>
+#include <vlc_block.h>
#include "iso_lang.h"
"16 char string (8 hexadecimal bytes).")
#define CPKT_TEXT N_("Packet size in bytes to encrypt")
-/// \bug [String] Extra space
#define CPKT_LONGTEXT N_("Size of the TS packet to encrypt. " \
"The encryption routines subtract the TS-header from the value before " \
- "encrypting. " )
+ "encrypting." )
#define SOUT_CFG_PREFIX "sout-ts-"
#ifdef HAVE_BSEARCH
vlc_value_t val;
int i;
- sout_CfgParse( p_mux, SOUT_CFG_PREFIX, ppsz_sout_options, p_mux->p_cfg );
+ config_ChainParse( p_mux, SOUT_CFG_PREFIX, ppsz_sout_options, p_mux->p_cfg );
p_sys = malloc( sizeof( sout_mux_sys_t ) );
if( !p_sys )
{
char *psz = p_input->p_fmt->p_extra_languages[i-1].psz_language;
const iso639_lang_t *pl = NULL;
-
+
if( strlen( psz ) == 2 )
{
pl = GetLang_1( psz );
p_stream->lang[i*3+0] = pl->psz_iso639_2T[0];
p_stream->lang[i*3+1] = pl->psz_iso639_2T[1];
p_stream->lang[i*3+2] = pl->psz_iso639_2T[2];
-
+
msg_Dbg( p_mux, " - lang=%c%c%c",
p_stream->lang[i*3+0], p_stream->lang[i*3+1],
p_stream->lang[i*3+2] );
i_header_size = 0x24;
b_data_alignment = 1;
}
+ else if( p_input->p_fmt->i_codec ==
+ VLC_FOURCC('d','v','b','s') )
+ {
+ /* EN 300 743 */
+ b_data_alignment = 1;
+ }
}
else if( p_data->i_length < 0 ||
p_data->i_length > 2000000 )
if( p_stream->i_stream_id == 0xa0 &&
p_data->i_pts <= 0 )
{
- /* XXX yes I know, it's awfull, but it's needed,
+ /* XXX yes I know, it's awful, but it's needed,
* so don't remove it ... */
p_data->i_pts = p_data->i_dts;
}
/* Select stream (lowest dts) */
for( i = 0, i_stream = -1, i_dts = 0; i < p_mux->i_nb_inputs; i++ )
{
- p_input = p_mux->pp_inputs[i];
p_stream = (ts_stream_t*)p_mux->pp_inputs[i]->p_sys;
if( p_stream->i_pes_dts == 0 )
break;
}
p_stream = (ts_stream_t*)p_mux->pp_inputs[i_stream]->p_sys;
+ p_input = p_mux->pp_inputs[i_stream];
/* do we need to issue pcr */
b_pcr = VLC_FALSE;
else if( i_size > STD_PES_PAYLOAD )
{
block_t *p_new = block_New( p_mux, STD_PES_PAYLOAD );
- p_mux->p_vlc->pf_memcpy( p_new->p_buffer, p_data->p_buffer, STD_PES_PAYLOAD );
+ p_mux->p_libvlc->pf_memcpy( p_new->p_buffer, p_data->p_buffer, STD_PES_PAYLOAD );
p_new->i_pts = p_data->i_pts;
p_new->i_dts = p_data->i_dts;
p_new->i_length = p_data->i_length * STD_PES_PAYLOAD
}
i_copy = __MIN( STD_PES_PAYLOAD - i_size, p_next->i_buffer );
- p_mux->p_vlc->pf_memcpy( &p_data->p_buffer[i_size], p_next->p_buffer,
+ p_mux->p_libvlc->pf_memcpy( &p_data->p_buffer[i_size], p_next->p_buffer,
i_copy );
p_next->i_pts += p_next->i_length * i_copy / p_next->i_buffer;
p_next->i_dts += p_next->i_length * i_copy / p_next->i_buffer;
}
else if( p_stream->i_codec == VLC_FOURCC('t','e','l','x') )
{
- dvbpsi_PMTESAddDescriptor( p_es, 0x56,
- p_stream->i_decoder_specific_info,
- p_stream->p_decoder_specific_info );
+ if( p_stream->i_decoder_specific_info )
+ {
+ dvbpsi_PMTESAddDescriptor( p_es, 0x56,
+ p_stream->i_decoder_specific_info,
+ p_stream->p_decoder_specific_info );
+ }
+ continue;
}
-#ifdef _DVBPSI_DR_59_H_
else if( p_stream->i_codec == VLC_FOURCC('d','v','b','s') )
{
/* DVB subtitles */
- dvbpsi_subtitling_dr_t descr;
- dvbpsi_subtitle_t sub;
- dvbpsi_descriptor_t *p_descr;
-
- memcpy( sub.i_iso6392_language_code, p_stream->lang, 3 );
- sub.i_subtitling_type = 0x10; /* no aspect-ratio criticality */
- sub.i_composition_page_id = p_stream->i_es_id & 0xFF;
- sub.i_ancillary_page_id = p_stream->i_es_id >> 16;
-
- descr.i_subtitles_number = 1;
- descr.p_subtitle[0] = sub;
-
- p_descr = dvbpsi_GenSubtitlingDr( &descr, 0 );
- /* Work around bug in old libdvbpsi */ p_descr->i_length = 8;
- dvbpsi_PMTESAddDescriptor( p_es, p_descr->i_tag,
- p_descr->i_length, p_descr->p_data );
+ if( p_stream->i_decoder_specific_info )
+ {
+ /* pass-through from the TS demux */
+ dvbpsi_PMTESAddDescriptor( p_es, 0x59,
+ p_stream->i_decoder_specific_info,
+ p_stream->p_decoder_specific_info );
+ }
+#ifdef _DVBPSI_DR_59_H_
+ else
+ {
+ /* from the dvbsub transcoder */
+ dvbpsi_subtitling_dr_t descr;
+ dvbpsi_subtitle_t sub;
+ dvbpsi_descriptor_t *p_descr;
+
+ memcpy( sub.i_iso6392_language_code, p_stream->lang, 3 );
+ sub.i_subtitling_type = 0x10; /* no aspect-ratio criticality */
+ sub.i_composition_page_id = p_stream->i_es_id & 0xFF;
+ sub.i_ancillary_page_id = p_stream->i_es_id >> 16;
+
+ descr.i_subtitles_number = 1;
+ descr.p_subtitle[0] = sub;
+
+ p_descr = dvbpsi_GenSubtitlingDr( &descr, 0 );
+ /* Work around bug in old libdvbpsi */ p_descr->i_length = 8;
+ dvbpsi_PMTESAddDescriptor( p_es, p_descr->i_tag,
+ p_descr->i_length, p_descr->p_data );
+ }
+#endif /* _DVBPSI_DR_59_H_ */
continue;
}
-#endif /* _DVBPSI_DR_59_H_ */
if( p_stream->lang[0] != 0 )
{