[FFmpeg-devel] [PATCH 2/4] wmavoice: disable bitstream checking.

Ronald S. Bultje rsbultje at gmail.com
Wed Dec 21 04:07:28 EET 2016


Hi,

On Tue, Dec 20, 2016 at 7:59 PM, Michael Niedermayer <michael at niedermayer.cc
> wrote:

> On Tue, Dec 20, 2016 at 07:51:05PM -0500, Ronald S. Bultje wrote:
> > Hi,
> >
> > On Tue, Dec 20, 2016 at 7:44 PM, Michael Niedermayer
> <michael at niedermayer.cc
> > > wrote:
> >
> > > On Tue, Dec 20, 2016 at 05:23:06PM -0500, Ronald S. Bultje wrote:
> > > > The checked bitstream reader does that already. To allow parsing of
> > > > superframes split over a packet boundary, we always decode the last
> > > > superframe in each packet at the start of the next packet, even if
> > > > theoretically we could have decoded it. The last superframe in the
> > > > last packet is decoded using AV_CODEC_CAP_DELAY.
> > > > ---
> > > >  libavcodec/wmavoice.c | 144 ++++++++++--------------------
> > > --------------------
> > > >  1 file changed, 29 insertions(+), 115 deletions(-)
> > >
> > > this causes
> > >
> > > tickets/1708/mss2_speech.wmv
> > >
> > > to show
> > > [wmavoice @ 0x7f7ec40726c0] WMAPro-in-WMAVoice is not implemented.
> Update
> > > your FFmpeg version to the newest one from Git. If the problem still
> > > occurs, it means that your file has a feature which has not been
> > > implemented.
> > > [wmavoice @ 0x7f7ec40726c0] If you want to help, upload a sample of
> this
> > > file to ftp://upload.ffmpeg.org/incoming/ and contact the ffmpeg-devel
> > > mailing list. (ffmpeg-devel at ffmpeg.org)
> > > [wmavoice @ 0x7f7ec40726c0] WMAPro-in-WMAVoice is not implemented.
> Update
> > > your FFmpeg version to the newest one from Git. If the problem still
> > > occurs, it means that your file has a feature which has not been
> > > implemented.
> > > [wmavoice @ 0x7f7ec40726c0] If you want to help, upload a sample of
> this
> > > file to ftp://upload.ffmpeg.org/incoming/ and contact the ffmpeg-devel
> > > mailing list. (ffmpeg-devel at ffmpeg.org)
> >
> >
> > See http://lists.ffmpeg.org/pipermail/ffmpeg-devel/2016-
> December/204656.html
> >
> > To confirm that's the issue, did the md5 change? If not, then it's a
> great
> > sample file and you should file a ticket so I finally have a valid sample
> > to implement wmapro-in-voice decoding (I still don't have any).
>
> The framecrc from before and after your patchset changes
> file should be here:
>
> http://samples.mplayerhq.hu/V-codecs/MSS2/mss2_speech.wmv


Aha, tested. Before the patch, we ignore the nb_superframes value. This can
lead to us reading more superframes per packet than are actually written in
the packet data. Even if the packet only has N bytes of useful data, it is
still padded to block_align bytes because ASF is stupid that way. So, for
the affected packets, after decoding N superframes correctly (as indicated
in the header value) and exhausting the valid data in some of these packets
(not necessarily just the final ones), we start reading the padding garbage
(and usually fail to do so), leading to some of the wmapro-in-wmavoice
warnings in some cases, and garbage decoding + timestamp warnings (because
last_ts + last_duration > this_ts after correct decoding resumes) in others.

After the patch, we correctly skip this padding garbage. This causes the
timestamp warnings to go away, and 4 out of 6 wmapro-in-wmavoice warnings
to go away also. Audibly, the result sounds identical; what's different is
the length of some of the silence sections. E.g. the start is 2/100th sec
silence shorter after compared to before the patch. Given my explanation
above, this is probably an improvement.

Ronald


More information about the ffmpeg-devel mailing list