[FFmpeg-devel] [FFmpeg-cvslog] avcodec/mlpdec: cover case when >2 channels are in single substream

Michael Niedermayer michael at niedermayer.cc
Tue Nov 23 01:00:54 EET 2021


On Fri, Nov 12, 2021 at 04:11:38PM +0100, Michael Niedermayer wrote:
> On Thu, Nov 11, 2021 at 08:56:54PM +0000, Paul B Mahol wrote:
> > ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Thu Nov 11 09:48:07 2021 +0100| [946493eb3e072b499909f606625480c928834a44] | committer: Paul B Mahol
> > 
> > avcodec/mlpdec: cover case when >2 channels are in single substream
> > 
> > Previously it was assumed that all >2 channels streams have >1 substreams.
> > 
> > > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=946493eb3e072b499909f606625480c928834a44
> > ---
> 
> This breaks:
>  ./ffmpeg -i  ~/tickets/1726/Mono.thd -bitexact -t 5 -y file1726.wav
> 
> video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
> Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)
> Conversion failed!
> 
> vs.
> 
> size=     938kB time=00:00:05.00 bitrate=1536.1kbits/s speed= 102x    
> video:0kB audio:938kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.004583%
>  
> sample probably here:
> http://samples.ffmpeg.org/ffmpeg-bugs/trac/ticket1726/Mono.thd

ping

This commit changed this:

@@ -417,7 +417,8 @@ static int read_major_sync(MLPDecodeContext *m, GetBitContext *gb)
                 m->substream[2].mask = mh.channel_layout_thd_stream2;
             else
                 m->substream[2].mask = mh.channel_layout_thd_stream1;
-        m->substream[mh.num_substreams > 1].mask = mh.channel_layout_thd_stream1;
+        if (m->avctx->channels > 2)
+            m->substream[mh.num_substreams > 1].mask = mh.channel_layout_thd_stream1;
 
         if (m->avctx->channels<=2 && m->substream[substr].mask == AV_CH_LAYOUT_MONO && m->max_decoded_substream == 1) {
             av_log(m->avctx, AV_LOG_DEBUG, "Mono stream with 2 substreams, ignoring 2nd\n");

before this  m->substream mask 0 1 and 2 up to num_substreams where initialized
after this change  m->substream mask 1 is not initialized when channels is 2 or less
but this mask is read the next line and that breaks the file linked above
             
Maybe iam missing something but this looks unintended

thx

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No human being will ever know the Truth, for even if they happen to say it
by chance, they would not even known they had done so. -- Xenophanes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20211123/18ba1c46/attachment.sig>


More information about the ffmpeg-devel mailing list