Changeset 496d33dc3e1c4be6407291c55ee5abebab4c79b7
- Timestamp:
- 20/12/07 00:59:06
(1 year ago)
- Author:
- Rafaël Carré <funman@videolan.org>
- git-committer:
- Rafaël Carré <funman@videolan.org> 1198108746 +0000
- git-parent:
[f4d1285582586efdc39d8c87753dc577f703389b]
- git-author:
- Rafaël Carré <funman@videolan.org> 1198108746 +0000
- Message:
playlist demuxers: return -1 in case of error, 0 in case of eof, 1 else; like any correct demuxer. (we always return eof since playlists don't need 2 successive demuxing).
fix a corner case bug in ifo.c
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r3f07af6 |
r496d33d |
|
| 252 | 252 | p_sys->psz_data = realloc( p_sys->psz_data, p_sys->i_data_len * sizeof( char * ) +1 ); |
|---|
| 253 | 253 | } |
|---|
| 254 | | if( p_sys->i_data_len <= 0 ) return VLC_EGENERIC; |
|---|
| | 254 | if( p_sys->i_data_len <= 0 ) return -1; |
|---|
| 255 | 255 | } |
|---|
| 256 | 256 | |
|---|
| … | … | |
| 689 | 689 | } |
|---|
| 690 | 690 | HANDLE_PLAY_AND_RELEASE; |
|---|
| 691 | | return -1; /* Needed for correct operation of go back */ |
|---|
| | 691 | return 0; /* Needed for correct operation of go back */ |
|---|
| 692 | 692 | } |
|---|
| 693 | 693 | |
|---|
| r6ee1e19 |
r496d33d |
|
| 288 | 288 | |
|---|
| 289 | 289 | HANDLE_PLAY_AND_RELEASE; |
|---|
| 290 | | return -1; /* Needed for correct operation of go back */ |
|---|
| | 290 | return 0; /* Needed for correct operation of go back */ |
|---|
| 291 | 291 | } |
|---|
| 292 | 292 | |
|---|
| rc00cfde |
r496d33d |
|
| 128 | 128 | |
|---|
| 129 | 129 | HANDLE_PLAY_AND_RELEASE; |
|---|
| 130 | | return -1; /* Needed for correct operation of go back */ |
|---|
| | 130 | return 0; /* Needed for correct operation of go back */ |
|---|
| 131 | 131 | } |
|---|
| 132 | 132 | |
|---|
| r3f07af6 |
r496d33d |
|
| 223 | 223 | p_sys->p_playlist = NULL; |
|---|
| 224 | 224 | |
|---|
| 225 | | return -1; /* Needed for correct operation of go back */ |
|---|
| | 225 | return 0; /* Needed for correct operation of go back */ |
|---|
| 226 | 226 | } |
|---|
| 227 | 227 | |
|---|
| r3f07af6 |
r496d33d |
|
| 58 | 58 | i_peek = stream_Peek( p_demux->s, &p_peek, 8 ); |
|---|
| 59 | 59 | |
|---|
| 60 | | if( strncmp( p_peek, "DVDVIDEO", 8 ) ) |
|---|
| | 60 | if( i_peek != 8 || memcmp( p_peek, "DVDVIDEO", 8 ) ) |
|---|
| 61 | 61 | return VLC_EGENERIC; |
|---|
| 62 | 62 | } |
|---|
| … | … | |
| 96 | 96 | HANDLE_PLAY_AND_RELEASE; |
|---|
| 97 | 97 | |
|---|
| 98 | | return -1; /* Needed for correct operation of go back */ |
|---|
| | 98 | return 0; /* Needed for correct operation of go back */ |
|---|
| 99 | 99 | } |
|---|
| 100 | 100 | |
|---|
| rc39b64d |
r496d33d |
|
| 121 | 121 | if( p_xml ) |
|---|
| 122 | 122 | xml_Delete( p_xml ); |
|---|
| 123 | | return -1; /* Needed for correct operation of go back */ |
|---|
| | 123 | return 0; /* Needed for correct operation of go back */ |
|---|
| 124 | 124 | } |
|---|
| 125 | 125 | |
|---|
| r18eea45 |
r496d33d |
|
| 220 | 220 | } |
|---|
| 221 | 221 | HANDLE_PLAY_AND_RELEASE; |
|---|
| 222 | | return -1; /* Needed for correct operation of go back */ |
|---|
| | 222 | return 0; /* Needed for correct operation of go back */ |
|---|
| 223 | 223 | } |
|---|
| 224 | 224 | |
|---|
| r3f07af6 |
r496d33d |
|
| 236 | 236 | |
|---|
| 237 | 237 | HANDLE_PLAY_AND_RELEASE; |
|---|
| 238 | | return -1; /* Needed for correct operation of go back */ |
|---|
| | 238 | return 0; /* Needed for correct operation of go back */ |
|---|
| 239 | 239 | } |
|---|
| 240 | 240 | |
|---|
| r6ee1e19 |
r496d33d |
|
| 321 | 321 | |
|---|
| 322 | 322 | HANDLE_PLAY_AND_RELEASE; |
|---|
| 323 | | return -1; /* Needed for correct operation of go back */ |
|---|
| | 323 | return 0; /* Needed for correct operation of go back */ |
|---|
| 324 | 324 | } |
|---|
| 325 | 325 | |
|---|
| r3429397 |
r496d33d |
|
| 376 | 376 | free( psz_mimetype ); |
|---|
| 377 | 377 | |
|---|
| 378 | | return -1; /* Needed for correct operation of go back */ |
|---|
| | 378 | return 0; /* Needed for correct operation of go back */ |
|---|
| 379 | 379 | } |
|---|
| 380 | 380 | |
|---|
| r3f07af6 |
r496d33d |
|
| 378 | 378 | { |
|---|
| 379 | 379 | msg_Err( p_demux, "A valid playlistitem could not be created" ); |
|---|
| 380 | | return VLC_EGENERIC; |
|---|
| | 380 | return -1; |
|---|
| 381 | 381 | } |
|---|
| 382 | 382 | |
|---|
| … | … | |
| 407 | 407 | input_ItemAddSubItem( p_current_input, p_child ); |
|---|
| 408 | 408 | HANDLE_PLAY_AND_RELEASE |
|---|
| 409 | | return -1; /* Needed for correct operation of go back */ |
|---|
| | 409 | return 0; /* Needed for correct operation of go back */ |
|---|
| 410 | 410 | } |
|---|
| 411 | 411 | |
|---|
| r3f07af6 |
r496d33d |
|
| 148 | 148 | HANDLE_PLAY_AND_RELEASE; |
|---|
| 149 | 149 | p_sys->p_playlist = NULL; |
|---|
| 150 | | return -1; /* Needed for correct operation of go back */ |
|---|
| | 150 | return 0; /* Needed for correct operation of go back */ |
|---|
| 151 | 151 | } |
|---|
| 152 | 152 | |
|---|
| rf4d1285 |
r496d33d |
|
| 71 | 71 | int Demux( demux_t *p_demux ) |
|---|
| 72 | 72 | { |
|---|
| 73 | | int i_ret = VLC_SUCCESS; |
|---|
| | 73 | int i_ret = 1; |
|---|
| 74 | 74 | xml_t *p_xml = NULL; |
|---|
| 75 | 75 | xml_reader_t *p_xml_reader = NULL; |
|---|
| … | … | |
| 84 | 84 | p_xml = xml_Create( p_demux ); |
|---|
| 85 | 85 | if( !p_xml ) |
|---|
| 86 | | i_ret = VLC_ENOMOD; |
|---|
| | 86 | i_ret = -1; |
|---|
| 87 | 87 | else |
|---|
| 88 | 88 | { |
|---|
| 89 | 89 | p_xml_reader = xml_ReaderCreate( p_xml, p_demux->s ); |
|---|
| 90 | 90 | if( !p_xml_reader ) |
|---|
| 91 | | i_ret = VLC_EGENERIC; |
|---|
| | 91 | i_ret = -1; |
|---|
| 92 | 92 | } |
|---|
| 93 | 93 | |
|---|
| 94 | 94 | /* locating the root node */ |
|---|
| 95 | | if( i_ret == VLC_SUCCESS ) |
|---|
| | 95 | if( i_ret == 1 ) |
|---|
| 96 | 96 | { |
|---|
| 97 | 97 | do |
|---|
| … | … | |
| 100 | 100 | { |
|---|
| 101 | 101 | msg_Err( p_demux, "can't read xml stream" ); |
|---|
| 102 | | i_ret = VLC_EGENERIC; |
|---|
| | 102 | i_ret = -1; |
|---|
| 103 | 103 | } |
|---|
| 104 | 104 | } while( i_ret == VLC_SUCCESS && |
|---|
| … | … | |
| 106 | 106 | } |
|---|
| 107 | 107 | /* checking root node name */ |
|---|
| 108 | | if( i_ret == VLC_SUCCESS ) |
|---|
| | 108 | if( i_ret == 1 ) |
|---|
| 109 | 109 | { |
|---|
| 110 | 110 | psz_name = xml_ReaderName( p_xml_reader ); |
|---|
| … | … | |
| 112 | 112 | { |
|---|
| 113 | 113 | msg_Err( p_demux, "invalid root node name: %s", psz_name ); |
|---|
| 114 | | i_ret = VLC_EGENERIC; |
|---|
| | 114 | i_ret = -1; |
|---|
| 115 | 115 | } |
|---|
| 116 | 116 | FREE_NAME(); |
|---|
| 117 | 117 | } |
|---|
| 118 | 118 | |
|---|
| 119 | | if( i_ret == VLC_SUCCESS ) |
|---|
| | 119 | if( i_ret == 1 ) |
|---|
| 120 | 120 | i_ret = parse_playlist_node( p_demux, p_playlist, p_current_input, |
|---|
| 121 | | p_xml_reader, "playlist" ) |
|---|
| 122 | | ? VLC_SUCCESS : VLC_EGENERIC; |
|---|
| | 121 | p_xml_reader, "playlist" ) ? 0 : -1; |
|---|
| | 122 | |
|---|
| | 123 | |
|---|
| 123 | 124 | HANDLE_PLAY_AND_RELEASE; |
|---|
| 124 | 125 | if( p_xml_reader ) |
|---|