Changeset 4ff2a9a24fc18d489e6b3c1203470ba5874df25b
- Timestamp:
- 03/09/05 17:55:52
(3 years ago)
- Author:
- Steve Lhomme <robux@videolan.org>
- git-committer:
- Steve Lhomme <robux@videolan.org> 1125762952 +0000
- git-parent:
[cb2ad9ec570fec13ea17a46a43518d8ef4ef84c1]
- git-author:
- Steve Lhomme <robux@videolan.org> 1125762952 +0000
- Message:
* prevent crashes when a stream is not opened correctly
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r39cc95b |
r4ff2a9a |
|
| 123 | 123 | va_list args; |
|---|
| 124 | 124 | int i_result; |
|---|
| | 125 | |
|---|
| | 126 | if ( s == NULL ) |
|---|
| | 127 | return VLC_EGENERIC; |
|---|
| 125 | 128 | |
|---|
| 126 | 129 | va_start( args, i_query ); |
|---|
| r8fd5f21 |
r4ff2a9a |
|
| 1482 | 1482 | { |
|---|
| 1483 | 1483 | // test wether this file belongs to our family |
|---|
| 1484 | | vlc_stream_io_callback *p_file_io = new vlc_stream_io_callback( stream_UrlNew( p_demux, s_filename.c_str()), VLC_TRUE ); |
|---|
| 1485 | | EbmlStream *p_estream = new EbmlStream(*p_file_io); |
|---|
| 1486 | | |
|---|
| 1487 | | p_stream = p_sys->AnalyseAllSegmentsFound( p_estream ); |
|---|
| 1488 | | if ( p_stream == NULL ) |
|---|
| | 1484 | stream_t *p_file_stream = stream_UrlNew( p_demux, s_filename.c_str()); |
|---|
| | 1485 | if ( p_file_stream != NULL ) |
|---|
| 1489 | 1486 | { |
|---|
| 1490 | | msg_Dbg( p_demux, "the file '%s' will not be used", s_filename.c_str() ); |
|---|
| 1491 | | delete p_estream; |
|---|
| 1492 | | delete p_file_io; |
|---|
| | 1487 | vlc_stream_io_callback *p_file_io = new vlc_stream_io_callback( p_file_stream, VLC_TRUE ); |
|---|
| | 1488 | EbmlStream *p_estream = new EbmlStream(*p_file_io); |
|---|
| | 1489 | |
|---|
| | 1490 | p_stream = p_sys->AnalyseAllSegmentsFound( p_estream ); |
|---|
| | 1491 | |
|---|
| | 1492 | if ( p_stream == NULL ) |
|---|
| | 1493 | { |
|---|
| | 1494 | msg_Dbg( p_demux, "the file '%s' will not be used", s_filename.c_str() ); |
|---|
| | 1495 | delete p_estream; |
|---|
| | 1496 | delete p_file_io; |
|---|
| | 1497 | } |
|---|
| | 1498 | else |
|---|
| | 1499 | { |
|---|
| | 1500 | p_stream->p_in = p_file_io; |
|---|
| | 1501 | p_stream->p_es = p_estream; |
|---|
| | 1502 | p_sys->streams.push_back( p_stream ); |
|---|
| | 1503 | } |
|---|
| 1493 | 1504 | } |
|---|
| 1494 | 1505 | else |
|---|
| 1495 | 1506 | { |
|---|
| 1496 | | p_stream->p_in = p_file_io; |
|---|
| 1497 | | p_stream->p_es = p_estream; |
|---|
| 1498 | | p_sys->streams.push_back( p_stream ); |
|---|
| | 1507 | msg_Dbg( p_demux, "the file '%s' cannot be opened", s_filename.c_str() ); |
|---|
| 1499 | 1508 | } |
|---|
| 1500 | 1509 | } |
|---|
| … | … | |
| 3325 | 3334 | uint64 vlc_stream_io_callback::getFilePointer( void ) |
|---|
| 3326 | 3335 | { |
|---|
| | 3336 | if ( s == NULL ) |
|---|
| | 3337 | return 0; |
|---|
| 3327 | 3338 | return stream_Tell( s ); |
|---|
| 3328 | 3339 | } |
|---|