}
if ( pes->probe_buf->size > HB_MAX_PROBE_SIZE )
{
- pes->stream_kind = N;
hb_buffer_close( &pes->probe_buf );
+ pes->probe_next_size = 0;
return 1;
}
pes->codec = HB_ACODEC_FFMPEG;
}
}
- else
- {
- pes->stream_kind = N;
- }
strncpy(pes->codec_name, codec->name, 79);
pes->codec_name[79] = 0;
}
- else
- {
- pes->stream_kind = N;
- }
hb_buffer_close( &pes->probe_buf );
return 1;
}
if ( ts_stream_kind( stream, ii ) == U )
{
- probe++;
+ probe = 3;
}
}
hb_stream_seek( stream, 0.0 );
stream->need_keyframe = 0;
- int total_size = 0;
hb_buffer_t *buf;
if ( probe )
while ( probe && ( buf = hb_ts_stream_decode( stream ) ) != NULL )
{
- // Check upper limit of total data to probe
- total_size += buf->size;
-
- if ( total_size > HB_MAX_PROBE_SIZE * 2 )
- {
- hb_buffer_close(&buf);
- break;
- }
-
int idx;
idx = index_of_id( stream, buf->s.id );
if ( do_probe( stream, pes, buf ) )
{
- probe--;
- if ( pes->stream_kind != N )
+ if ( pes->stream_kind != U )
{
hb_log(" Probe: Found stream %s. stream id 0x%x-0x%x",
pes->codec_name, pes->stream_id, pes->stream_id_ext);
+ probe = 0;
}
else
{
- hb_log(" Probe: Unsupported stream %s. stream id 0x%x-0x%x",
- pes->codec_name, pes->stream_id, pes->stream_id_ext);
+ probe--;
+ if (!probe)
+ {
+ hb_log(" Probe: Unsupported stream %s. stream id 0x%x-0x%x",
+ pes->codec_name, pes->stream_id, pes->stream_id_ext);
+ pes->stream_kind = N;
+ }
}
}
hb_buffer_close(&buf);
if ( stream->pes.list[ii].stream_kind == U )
{
- probe++;
+ probe = 3;
}
}
hb_stream_seek( stream, 0.0 );
stream->need_keyframe = 0;
- int total_size = 0;
hb_buffer_t *buf;
if ( probe )
while ( probe && ( buf = hb_ps_stream_decode( stream ) ) != NULL )
{
- // Check upper limit of total data to probe
- total_size += buf->size;
-
- if ( total_size > HB_MAX_PROBE_SIZE * 2 )
- {
- hb_buffer_close(&buf);
- break;
- }
-
int idx;
idx = index_of_id( stream, buf->s.id );
if ( do_probe( stream, pes, buf ) )
{
- probe--;
- if ( pes->stream_kind != N )
+ if ( pes->stream_kind != U )
{
hb_log(" Probe: Found stream %s. stream id 0x%x-0x%x",
pes->codec_name, pes->stream_id, pes->stream_id_ext);
+ probe = 0;
}
else
{
- hb_log(" Probe: Unsupported stream %s. stream id 0x%x-0x%x",
- pes->codec_name, pes->stream_id, pes->stream_id_ext);
+ probe--;
+ if (!probe)
+ {
+ hb_log(" Probe: Unsupported stream %s. stream id 0x%x-0x%x",
+ pes->codec_name, pes->stream_id, pes->stream_id_ext);
+ pes->stream_kind = N;
+ }
}
}
hb_buffer_close(&buf);