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

The Wanderer wanderer at fastmail.fm
Wed Mar 17 21:39:28 EET 2021

On 2021-03-17 at 14:56, Reimar Döffinger wrote:

> On Wed, Mar 17, 2021 at 12:13:08PM -0400, The Wanderer wrote:
>> Index: configure
>> ===================================================================
>> --- configure	(revision 38303)
>> +++ configure	(working copy)
>> @@ -736,6 +736,7 @@
>>  _kai=auto
>>  _dart=auto
>>  _openal=auto
>> +_libxml2=auto
> Possibly should add a enable/disable option as well?
> Might make it easier to test this code without having
> to install and uninstall the -dev package.

I knew I'd forgotten *something*. Thanks; added.

I'm not entirely sure what to use as the brief description (in the help
text) of what this feature adds, but I've taken a stab at it.

> Also it's pointless if internal FFmpeg is disabled,
> maybe have it forced to no in that case?

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?

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.

(Updated patch not yet attached, because of the below questions.)

>> +echocheck "libxml2"
>> +if test "$_libxml2" = auto; then
>> +        cat > $TMPC << EOF
>> +#include <libxml/xmlstring.h>
>> +int main() {
>> +  xmlChar *str = "";
>> +  return xmlStrlen(str);
>> +}
>> +EOF
>> +    _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.

I can certainly do it, but am hesitant to break with existing practice
that way without getting confirmation.

Working to implement this, before I noticed that consideration, has led
me to improve the detection; it will now skip autodetection and disable
the feature if pkg-config doesn't see libxml2 as installed.

>> +        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.

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.

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 Wanderer

The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all
progress depends on the unreasonable man.         -- George Bernard Shaw

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.mplayerhq.hu/pipermail/mplayer-users/attachments/20210317/96f9083d/attachment.sig>

More information about the MPlayer-users mailing list