[vlc-devel] [vlc-commits] mp4: fix stream size handling
Rémi Denis-Courmont
remi at remlab.net
Wed Nov 29 12:56:30 CET 2017
Le 29 novembre 2017 12:42:17 GMT+02:00, Thomas Guillem <thomas at gllm.fr> a écrit :
>This commit partially reverts d12f3d7091e28b022c9cd1698d2ccdbd876fcb3c
>
>Why ?
>
>As you already recalled it: "there is a rule not revert other people´s
>work without
>discussion".
>
>On Tue, Nov 28, 2017, at 18:51, Rémi Denis-Courmont wrote:
>> vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue
>Nov 28
>> 19:51:17 2017 +0200| [3167e69ab7a4783b0e564bc4e0f9aa5304be444d] |
>> committer: Rémi Denis-Courmont
>>
>> mp4: fix stream size handling
>>
>> >
>http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3167e69ab7a4783b0e564bc4e0f9aa5304be444d
>> ---
>>
>> modules/demux/mp4/libmp4.c | 9 ++-------
>> 1 file changed, 2 insertions(+), 7 deletions(-)
>>
>> diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
>> index e811af20ec..a4a0d4f821 100644
>> --- a/modules/demux/mp4/libmp4.c
>> +++ b/modules/demux/mp4/libmp4.c
>> @@ -199,11 +199,6 @@ static int MP4_PeekBoxHeader( stream_t
>*p_stream,
>> MP4_Box_t *p_box );
>>
>> int MP4_Seek( stream_t *p_stream, uint64_t i_pos )
>> {
>> - /* Prevent prefetch breakage */
>> - uint64_t i_size = stream_Size( p_stream );
>> - if( i_size > 0 && i_pos >= i_size )
>> - return VLC_EGENERIC;
>> -
>> bool b_canseek = false;
>> if ( vlc_stream_Control( p_stream, STREAM_CAN_SEEK, &b_canseek )
>!=
>> VLC_SUCCESS ||
>> b_canseek )
>> @@ -4921,8 +4916,8 @@ MP4_Box_t *MP4_BoxGetRoot( stream_t *p_stream )
>> return NULL;
>>
>> p_vroot->i_shortsize = 1;
>> - int64_t i_size = stream_Size( p_stream );
>> - if( i_size > 0 )
>> + uint64_t i_size;
>> + if( vlc_stream_GetSize( p_stream, &i_size ) == 0 )
>> p_vroot->i_size = i_size;
>>
>> /* First get the moov */
>>
>> _______________________________________________
>> vlc-commits mailing list
>> vlc-commits at videolan.org
>> https://mailman.videolan.org/listinfo/vlc-commits
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel
I fixed all stream_Size() uses (both of them really) in that file. The first block made zero sense and was removed completely.
--
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.
More information about the vlc-devel
mailing list