Quoting James Almer (2016-09-18 19:07:52)
> The guessed layout was being stored in the decoder context, which in the case 
> of
> stream copy is unused.
> Signed-off-by: James Almer <jamr...@gmail.com>
> ---
> Didn't run FATE after this patch, but aside from guess_input_channel_layout()
> nothing seemed to be using ist->dec_ctx inside the switch statement, so moving
> the avcodec_parameters_to_context() call down shouldn't break anything.
> Unless i'm missing something, this may be the first case of an input codecpar
> being modified outside of the demuxer that filled it.
> I assume this is acceptable, otherwise the solution would probably be more
> complex or less clean.

I tend to disagree here -- the doxy in lavf says that when demuxing
codecpar is filled by lavf. I would interpret this as meaning that the
caller is not allowed to randomly modify it and the demuxer may rely on
the information in it staying the same.

This specific change probably won't break any actual demuxers, but as
avconv tends to be seen as the "reference API user", I'd prefer it to
use the API correctly. It shouldn't be much work to make a private copy
of the codecpar and modify that instead.

Anton Khirnov
libav-devel mailing list

Reply via email to