Opened 5 years ago

Closed 5 years ago

#12547 closed bug (fixed)

MediaPlayer aborts with assertion a->planar failed at libswresample/swresample.c:284

Reported by: markh Owned by: stippi
Priority: normal Milestone: R1/beta1
Component: Applications/MediaPlayer Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

MediaPlayer aborts with assertion a->planar failed at libswresample/swresample.c:284 when playing some files. A test file where this occurs can be found at http://samples.ffmpeg.org/A-codecs/WMA/mplayer_sample-audio_0x161.wmv

This worked fine previously, though I don't know exactly which revision it stopped working. I am not getting a debug report, so I have not attached one. Is there another way to create it?

Created as a new ticket on the suggestion of pulkomandy instead of as part of #12509.

Attachments (1)

0001-ffmpeg-addon-only-use-swresample-for-planar-audio.patch (3.6 KB ) - added by jessicah 5 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 by kim1963, 5 years ago

hrev49937 open playlist item: Son ar Sistr.m4a [SWR @ 0x19810220] Input channel count and layout are unset _InitFromTrack(): keyframes: 1, frame count: 8504831 Assertion a->planar failed at libswresample/swresample.c:284 Abort Abort ~> open playlist item: Los_Palmeras_-_El_Bombon_Asesino.wma [SWR @ 0x18778f30] Input channel count and layout are unset _InitFromTrack(): keyframes: 1, frame count: 9081645 Assertion a->planar failed at libswresample/swresample.c:284 Abort Abort ~> hrev49930 - OK!!!

comment:3 by pulkomandy, 5 years ago

By the time we initialize libswresample, it doesn't know the number of audio channels yet:

[SWR @ 0x18778f30] Input channel count and layout are unset

So, it doesn't initialize properly, and later on, there is an assert() in the code so it just stops (which is why you don't get the "debug" dialog, this is a purposeful exit from ffmpeg).

A possible solution is delaying the init as much as possible, to a point where we are sure the audio channels layout is known.

comment:4 by kim1963, 5 years ago

hrev49930 - media files of all formats - MediaPlayer work fine.

comment:5 by jessicah, 5 years ago

patch: 01

comment:6 by jessicah, 5 years ago

FWIW, this fixes playback of the files in zipfile provided by kim1963. The mplayer sample video plays for a little while, then runs into some playback error -- same error also happens when trying to seek.

Existing working files still work, YouTube audio still works (doesn't fix the video playback).

I'm not sure whether this is the right approach to take, so have attached as a patch rather than committing.

comment:7 by pulkomandy, 5 years ago

I would use int av_sample_fmt_is_planar(enum AVSampleFormat sample_fmt) if possible. (https://ffmpeg.org/doxygen/2.0/samplefmt_8h.html#a06ba8a64dc4382c422789a5d0b6bf592)

If we do this, since ffmpeg 0.10 always uses packed formats, we can remove the check on version I have added on the resampling version of the code (it will always be used only with newer ffmpeg anyway).

comment:8 by pulkomandy, 5 years ago

Resolution: fixed
Status: newclosed

Applied in hrev49952, with an extra change to use an existing ffmpeg function to detect if a format is planar.

Note: See TracTickets for help on using tickets.