Skip to content
Snippets Groups Projects
Commit 4433c3f1 authored by dork's avatar dork
Browse files

Backport 'Fix missing audio channels from Sony camera'

parent 6a250110
No related branches found
No related tags found
No related merge requests found
Pipeline #5704 passed
......@@ -66,17 +66,20 @@ static void setup_input_stream(char *stream, AVFormatContext *demux,
else if (type == AVMEDIA_TYPE_AUDIO)
{
// Set channel layout to default if not set
if(decs[idx]->ch_layout.order == AV_CHANNEL_ORDER_UNSPEC)
if(!decs[idx]->channel_layout)
decs[idx]->channel_layout = av_get_default_channel_layout(decs[idx]->channels);
/*if(decs[idx]->ch_layout.order == AV_CHANNEL_ORDER_UNSPEC)
av_channel_layout_default(&decs[idx]->ch_layout, decs[idx]->ch_layout.nb_channels);
char ch_layout[64];
err = av_channel_layout_describe(&decs[idx]->ch_layout, ch_layout, sizeof(ch_layout));
if (err < 0)
job_failed("Could not describe channel layout: %s", av_err2str(err));
job_failed("Could not describe channel layout: %s", av_err2str(err));*/
p = mprintf("time_base=%d/%d:sample_rate=%d:sample_fmt=%d:channel_layout=%s:channels=%d",
demux->streams[idx]->time_base.num, demux->streams[idx]->time_base.den,
decs[idx]->sample_rate, decs[idx]->sample_fmt, ch_layout,
decs[idx]->sample_rate, decs[idx]->sample_fmt, decs[idx]->channel_layout,
decs[idx]->channels);
err = avfilter_graph_create_filter(&srcs[idx],
avfilter_get_by_name("abuffer"), 0, p, 0, fg);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment