[vlc-devel] [PATCH 01/11] ogg: don't call pf_demux() directly

Steve Lhomme robux4 at gmail.com
Tue May 3 08:09:55 CEST 2016


On Mon, May 2, 2016 at 7:45 PM, Steve Lhomme <robux4 at gmail.com> wrote:
> On Mon, May 2, 2016 at 6:59 PM, Rémi Denis-Courmont <remi at remlab.net> wrote:
>> Le 2016-05-02 18:24, Steve Lhomme a écrit :
>>>
>>> ---
>>>  modules/demux/ogg.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/modules/demux/ogg.c b/modules/demux/ogg.c
>>> index 40b26c6..8b47e86 100644
>>> --- a/modules/demux/ogg.c
>>> +++ b/modules/demux/ogg.c
>>> @@ -246,7 +246,7 @@ static int Open( vlc_object_t * p_this )
>>>      TAB_INIT( p_sys->i_seekpoints, p_sys->pp_seekpoints );
>>>
>>>
>>> -    while ( !p_sys->b_preparsing_done && p_demux->pf_demux( p_demux ) > 0
>>> )
>>> +    while ( !p_sys->b_preparsing_done && demux_Demux( p_demux ) > 0 )
>>
>>
>> This patch itself looks OK, but something is wrong if you depend on it.
>
> Yes, the problem is the way a lot of the code is using demuxers. They
> often use p_demux->s and in the core there's code that work
> differently whether the demuxer as a stream or not. If I go with my
> previous way, each filter would be a demux_t, with at least the stream
> copied (but it's not the owner). I don't know to what extent
> everything else needs to be copied and updated to all these values
> need to be monitored or not. That's why I think the demuxer being
> untouched might be a better idea, even though it means not accessing
> pf_demux and pf_control directly. Maybe they could be made private ?

I originally tried the union between 's' and the wrapped demuxer for
filters. But there were cases where it would assume 's' is set and use
it as a stream_t producing crashes.

I'll try again the solution where demux-filters are just dumb demuxers.

>>>      {}
>>>
>>>      return VLC_SUCCESS;
>>
>>
>> --
>> Rémi Denis-Courmont
>> http://www.remlab.net/
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list