[FFmpeg-devel] [PATCH]Fix changed channel layout log info
Nicolas George
george at nsup.org
Mon Mar 16 13:29:04 CET 2015
Le sextidi 26 ventôse, an CCXXIII, Carl Eugen Hoyos a écrit :
> It seems to me that the line that is shown when the channel
> layout changes uses an incorrect new layout.
> The current output can be (line breaks for readability):
>
> Input stream #0:1 frame changed from
> rate:48000 fmt:fltp ch:8 chl:7.1 to
> rate:48000 fmt:fltp ch:8 chl:7.1
>
> if the channel layout changes to "8 channels).
I do not experience the problem. Can you share the sample?
> diff --git a/ffmpeg.c b/ffmpeg.c
> index 0f67b11..4e6e471 100644
> --- a/ffmpeg.c
> +++ b/ffmpeg.c
> @@ -1870,13 +1870,13 @@ static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output)
> ist->st->index);
> exit_program(1);
> }
> - decoded_frame->channel_layout = avctx->channel_layout;
> -
> av_get_channel_layout_string(layout1, sizeof(layout1), ist->resample_channels,
> ist->resample_channel_layout);
> av_get_channel_layout_string(layout2, sizeof(layout2), avctx->channels,
> decoded_frame->channel_layout);
>
> + decoded_frame->channel_layout = avctx->channel_layout;
> +
> av_log(NULL, AV_LOG_INFO,
> "Input stream #%d:%d frame changed from rate:%d fmt:%s ch:%d chl:%s to rate:%d fmt:%s ch:%d chl:%s\n",
> ist->file_index, ist->st->index,
The line you change seems completely wrong by itself. IMHO, it should read
something like "av_assert0(decoded_frame->channel_layout ==
avctx->channel_layout);", to allow finding the places where lavc returns
inconsistent layouts. Or maybe I am missing something.
Regards,
--
Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150316/932a1060/attachment.asc>
More information about the ffmpeg-devel
mailing list