# HG changeset patch # User nicodvb # Date 1181413221 0 # Node ID 53d57a0ebe13d31f1b04dd4764fb292ff71c852d # Parent b1487ec8c66c94688714908620e52a12a99c8aec init ts_probe to 0 and probe up to TS_MAX_PROBE_SIZE if the parameter is not explicitly set by the user; make the code that checks audio-only stream files respect -tsprobe diff -r b1487ec8c66c -r 53d57a0ebe13 libmpdemux/demux_ts.c --- a/libmpdemux/demux_ts.c Sat Jun 09 17:32:49 2007 +0000 +++ b/libmpdemux/demux_ts.c Sat Jun 09 18:20:21 2007 +0000 @@ -59,7 +59,7 @@ int ts_prog; int ts_keep_broken=0; -off_t ts_probe = TS_MAX_PROBE_SIZE; +off_t ts_probe = 0; extern char *dvdsub_lang, *audio_lang; //for -alang typedef enum @@ -621,7 +621,7 @@ int video_found = 0, audio_found = 0, sub_found = 0, i, num_packets = 0, req_apid, req_vpid, req_spid; int is_audio, is_video, is_sub, has_tables; int32_t p, chosen_pid = 0; - off_t pos=0, ret = 0, init_pos; + off_t pos=0, ret = 0, init_pos, end_pos; ES_stream_t es; unsigned char tmp[TS_FEC_PACKET_SIZE]; ts_priv_t *priv = (ts_priv_t*) demuxer->priv; @@ -641,7 +641,8 @@ memset(pes_priv1, 0, sizeof(pes_priv1)); init_pos = stream_tell(demuxer->stream); mp_msg(MSGT_DEMUXER, MSGL_V, "PROBING UP TO %"PRIu64", PROG: %d\n", (uint64_t) param->probe, param->prog); - while((pos <= init_pos + param->probe) && (! demuxer->stream->eof)) + end_pos = init_pos + (param->probe ? param->probe : TS_MAX_PROBE_SIZE); + while((pos <= end_pos) && (! demuxer->stream->eof)) { pos = stream_tell(demuxer->stream); if(ts_parse(demuxer, &es, tmp, 1)) @@ -777,7 +778,7 @@ } - if(((req_vpid == -2) || (num_packets >= NUM_CONSECUTIVE_AUDIO_PACKETS)) && audio_found) + if(((req_vpid == -2) || (num_packets >= NUM_CONSECUTIVE_AUDIO_PACKETS)) && audio_found && !param->probe) { //novideo or we have at least 348 audio packets (64 KB) without video (TS with audio only) param->vtype = 0;