[MPlayer-users] Playing DASH streams / .mpd files

Reimar Döffinger Reimar.Doeffinger at gmx.de
Wed Mar 17 22:06:31 EET 2021


On Wed, Mar 17, 2021 at 03:39:28PM -0400, The Wanderer wrote:
> Reasonable. I've taken a stab at it, based on my best reading of how
> internal FFmpeg enable/disable is stored; the variable names don't seem
> obvious at a glance, but I think ffmpeg_a (static) is internal, and
> ffmpeg_so (dynamic) is external, correct?

Yes

> That required moving the check after the ffmpeg_a (etc.) checks are run,
> but that shouldn't be an issue, although it does bring back my
> uncertainty about where best to position this.

It's the wild west, whereever works :)

> >> +    _libxml2=no
> >> +    inc_tmp=$($_pkg_config --cflags libxml-2.0)
> >> +    ld_tmp=$($_pkg_config --libs libxml-2.0)
> >> +    cc_check $inc_tmp $ld_tmp && _libxml2=yes
> >> +    if test "$_libxml2" = yes; then
> >
> > If adding a enable/disable option, this part
> > probably should go outside of the "auto" if.
>
> Are you sure? That'd be reasonable if we're doing detection when
> explicitly enabled, but at least as I recall matters, that's not the
> usual MPlayer configure semantics; we usually assume that if you pass an
> explicit --enable argument for something that has autodetection, you're
> going to be passing the necessary CFLAGS/LDFLAGS/etc. via other
> arguments, since you're overriding autodetection anyway.

> >> +        extra_ldflags="$extra_ldflags $ld_tmp"
> >> +        extra_cflags="$extra_cflags $inc_tmp"
> >> +    fi
> >
> > Most importantly you would want to remove DASH from here (approx. line 1661):
> > libavdemuxers=$(filter_out_component demuxer 'AVISYNTH DASH LIB[A-Z0-9_]* REDIR VAPOURSYNTH')
> > and in the "else" case when libxml2 is disabled do a
> > libavdemuxers=$(filter_out_component demuxer 'DASH')
> > Otherwise the patch looks like the right approach, yes.
>
> So is this effectively a check for whether to enable that component or
> not? I was treating it as a check for whether libxml2 is present, with
> the idea that we could then add a check for DASH which would itself
> reference the result of the libxml2 check.

Both questions kind of have the same answer.
I guess I explained the lazy way, but I guess your are right.
It should look approximately like (using Python style pseudocode)

if auto:
   if autodetect pass:
      set compiler/linker flags

if no:
   disable dependent features like DASH

I was suggesting the lazy way of just handling both the autodetect pass
and the disabled/autodetect fail in a single if, but you are right
it makes more sense to do it separately.
(also I admit that it might make more sense to have the dependent
features disabled by default and enable them if libxml2 is detected,
but I think that might be harder to do for FFmpeg components/features -
but I've not checked)

> I suppose there's not much point to that as long as we don't have any
> other code that would require libxml2, so we might as well put it all
> together for now, and split it out with separate disabling options
> later. I'll update things with that approach for now.

I don't think it makes sense to split out even further than that.
There is already --disable-demuxer= option, I guess if you want to
be thorough you could test that it still works with whatever you
implement.

> The patch with the above changes, except for letting --enable still do
> autodetection of the necessary flags, has been compile-tested without
> issues; I haven't tried running the result, and I don't know any DASH
> streams to test with.

The original email starting all this has an example DASH stream :)


More information about the MPlayer-users mailing list