Web lists-archives.com

Re: [MPlayer-dev-eng] MPlayer broken with FFmpeg 2.6 or newer or master branch Libav




On Sat, May 09, 2015 at 11:11:07AM -0400, sean darcy wrote:
> On 03/26/2015 08:12 PM, Brad Smith wrote:
> >On 03/26/15 19:31, Alexander Strasser wrote:
> >>On 2015-03-26 15:54 -0400, Brad Smith wrote:
> >>>MPlayer at the moment is broken with FFmpeg 2.6 or newer or master
> >>>branch Libav.
> >>>
> >>>Able to provide a fix?
> >>
> >>   Are you trying latest release?
> >
> >For the OpenBSD port / package I use snapshots that I roll from time to
> >time. With the current snap being from 20141103.
> >
> >>   Is is outdated :(  We should make a new release soon.
> >>
> >>   The bug has been fixed in latest svn trunk, the fix
> >>is not ideal but it will work with newer FFmpeg versions.
> >
> >Oh, my bad, sorry for the noise. I see rev 37372. I'll lift that.
> >
> >Thanks for pointing that out.
> >
> Using today's svn R37396 and ffmpeg 2.6:
> 
> ............
> libmpcodecs/ad_spdif.c: In function 'init':
> libmpcodecs/ad_spdif.c:133:23: error: dereferencing pointer to incomplete
> type
>      lavf_ctx->internal->raw_packet_buffer_remaining_size =
> RAW_PACKET_BUFFER_SIZE;
>                        ^
> libmpcodecs/ad_spdif.c:133:60: error: 'RAW_PACKET_BUFFER_SIZE' undeclared
> (first use in this function)
>      lavf_ctx->internal->raw_packet_buffer_remaining_size =
> RAW_PACKET_BUFFER_SIZE;
>                                                             ^
> libmpcodecs/ad_spdif.c:133:60: note: each undeclared identifier is reported
> only once for each function it appears in
> Makefile:731: recipe for target 'libmpcodecs/ad_spdif.o' failed

Didn't someone else say that's due to an incomplete internal.h header?
Either way, any users of that file around that can test this patch:
--- a/libmpcodecs/ad_spdif.c
+++ b/libmpcodecs/ad_spdif.c
@@ -112,6 +112,9 @@ static int init(sh_audio_t *sh)
     lavf_ctx->oformat = av_guess_format(FILENAME_SPDIFENC, NULL, NULL);
     if (!lavf_ctx->oformat)
         goto fail;
+    // HACK to ensure raw_packet_buffer_remaining_size is initialized properly
+    // with older FFmpeg versions.
+    ff_read_frame_flush(lavf_ctx);
     lavf_ctx->priv_data = av_mallocz(lavf_ctx->oformat->priv_data_size);
     if (!lavf_ctx->priv_data)
         goto fail;
@@ -130,7 +133,6 @@ static int init(sh_audio_t *sh)
             break;
         }
     }
-    lavf_ctx->internal->raw_packet_buffer_remaining_size = RAW_PACKET_BUFFER_SIZE;
     if (AVERROR_PATCHWELCOME == lavf_ctx->oformat->write_header(lavf_ctx)) {
         mp_msg(MSGT_DECAUDIO,MSGL_INFO,
                "This codec is not supported by spdifenc.\n");

_______________________________________________
MPlayer-dev-eng mailing list
MPlayer-dev-eng@xxxxxxxxxxxx
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng