Changeset 0afe6776db69252dbba8dbb5a6bbe51f8f1c4822
- Timestamp:
- 10/26/07 10:35:52 (11 months ago)
- git-parent:
- Files:
-
- modules/mux/mpeg/ts.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/mux/mpeg/ts.c
r22ec91d r0afe677 1337 1337 p_stream = (ts_stream_t*)p_input->p_sys; 1338 1338 1339 if( ( p_stream == p_pcr_stream&&1340 p_stream->i_pes_length < i_shaping_delay) ||1341 p_stream->i_pes_dts + p_stream->i_pes_length <1342 p_pcr_stream->i_pes_dts + p_pcr_stream->i_pes_length)1339 if( ( ( p_stream == p_pcr_stream ) && 1340 ( p_stream->i_pes_length < i_shaping_delay ) ) || 1341 ( p_stream->i_pes_dts + p_stream->i_pes_length < 1342 p_pcr_stream->i_pes_dts + p_pcr_stream->i_pes_length ) ) 1343 1343 { 1344 1344 /* Need more data */ 1345 1345 if( block_FifoCount( p_input->p_fifo ) <= 1 ) 1346 1346 { 1347 if( p_input->p_fmt->i_cat == AUDIO_ES||1348 p_input->p_fmt->i_cat == VIDEO_ES)1347 if( ( p_input->p_fmt->i_cat == AUDIO_ES ) || 1348 ( p_input->p_fmt->i_cat == VIDEO_ES ) ) 1349 1349 { 1350 1350 /* We need more data */ … … 1356 1356 continue; 1357 1357 } 1358 else 1358 else if( p_input->p_fmt->i_cat == SPU_ES ) 1359 1359 { 1360 1360 /* Don't mux the SPU yet if it is too early */ … … 1364 1364 p_spu->i_dts - p_pcr_stream->i_pes_dts; 1365 1365 1366 if( i_spu_delay > i_shaping_delay&&1367 i_spu_delay < I64C(100000000) )1366 if( ( i_spu_delay > i_shaping_delay ) && 1367 ( i_spu_delay < I64C(100000000) ) ) 1368 1368 continue; 1369 1369 1370 if ( i_spu_delay >= I64C(100000000)1371 || i_spu_delay < I64C(10000) )1370 if ( ( i_spu_delay >= I64C(100000000) ) || 1371 ( i_spu_delay < I64C(10000) ) ) 1372 1372 { 1373 1373 BufferChainClean( p_mux->p_sout, … … 2212 2212 sout_mux_sys_t *p_sys = p_mux->p_sys; 2213 2213 block_t *p_pmt[MAX_PMT]; 2214 block_t *p_sdt; 2215 2216 dvbpsi_sdt_t sdt; 2214 2217 2215 dvbpsi_pmt_es_t *p_es; 2218 dvbpsi_psi_section_t *p_section[MAX_PMT], *p_section2; 2219 dvbpsi_sdt_service_t *p_service; 2220 char *psz_sdt_desc; 2216 dvbpsi_psi_section_t *p_section[MAX_PMT]; 2217 2221 2218 int i_pidinput; 2222 2223 2219 int i_stream; 2224 2220 int i; 2225 2221 int *p_usepid = NULL; 2222 2223 #ifdef HAVE_DVBPSI_SDT 2224 block_t *p_sdt; 2225 dvbpsi_sdt_t sdt; 2226 2227 dvbpsi_psi_section_t* p_section2; 2228 dvbpsi_sdt_service_t *p_service; 2229 2230 uint8_t *psz_sdt_desc; 2231 #endif 2226 2232 2227 2233 if( p_sys->dvbpmt == NULL ) … … 2254 2260 2255 2261 /* FIXME: Ineffecient malloc's & ugly code...... */ 2256 if( psz_sdtprov != NULL && psz_sdtserv != NULL)2262 if( ( psz_sdtprov != NULL ) && ( psz_sdtserv != NULL ) ) 2257 2263 { 2258 2264 psz_sdt_desc = malloc( 3 + strlen(psz_sdtprov) 2259 2265 + strlen(psz_sdtserv) ); 2260 psz_sdt_desc[0] = 0x01; /* digital television service */ 2261 2262 /* service provider name length */ 2263 psz_sdt_desc[1] = (char)strlen(psz_sdtprov); 2264 memcpy( &psz_sdt_desc[2], psz_sdtprov, strlen(psz_sdtprov) ); 2265 2266 /* service name length */ 2267 psz_sdt_desc[ 2 + strlen(psz_sdtprov) ] 2268 = (char)strlen(psz_sdtserv); 2269 memcpy( &psz_sdt_desc[3+strlen(psz_sdtprov)], psz_sdtserv, 2270 strlen(psz_sdtserv) ); 2271 2272 dvbpsi_SDTServiceAddDescriptor( p_service, 0x48, 2273 3 + strlen(psz_sdtprov) + strlen(psz_sdtserv), 2274 psz_sdt_desc ); 2275 free( psz_sdt_desc ); 2266 if( psz_sdt_desc ) 2267 { 2268 psz_sdt_desc[0] = 0x01; /* digital television service */ 2269 2270 /* service provider name length */ 2271 psz_sdt_desc[1] = (char)strlen(psz_sdtprov); 2272 memcpy( &psz_sdt_desc[2], psz_sdtprov, strlen(psz_sdtprov) ); 2273 2274 /* service name length */ 2275 psz_sdt_desc[ 2 + strlen(psz_sdtprov) ] 2276 = (char)strlen(psz_sdtserv); 2277 memcpy( &psz_sdt_desc[3+strlen(psz_sdtprov)], psz_sdtserv, 2278 strlen(psz_sdtserv) ); 2279 2280 dvbpsi_SDTServiceAddDescriptor( p_service, 0x48, 2281 3 + strlen(psz_sdtprov) + strlen(psz_sdtserv), 2282 (uint8_t *)psz_sdt_desc ); 2283 free( psz_sdt_desc ); 2284 psz_sdt_desc = NULL; 2285 } 2276 2286 } 2277 2287 #undef psz_sdtprov
