extremely limited speed support implemented #120
This commit is contained in:
@@ -46,12 +46,3 @@ MediaStream* Media::get_stream_from_file_index(bool video, int index) {
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int guess_layout_from_channels(int channel_count) {
|
||||
if (channel_count == 1) {
|
||||
return AV_CH_LAYOUT_MONO;
|
||||
} else {
|
||||
qDebug() << "[WARNING] Could not detect audio channel layout - assuming stereo";
|
||||
return AV_CH_LAYOUT_STEREO;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,6 +50,4 @@ struct Media {
|
||||
void reset();
|
||||
};
|
||||
|
||||
int guess_layout_from_channels(int channel_count);
|
||||
|
||||
#endif // MEDIA_H
|
||||
|
||||
@@ -110,7 +110,7 @@ void PreviewGenerator::generate_waveform() {
|
||||
avcodec_open2(codec_ctx[i], codec, NULL);
|
||||
|
||||
if (fmt_ctx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO && codec_ctx[i]->channel_layout == 0) {
|
||||
codec_ctx[i]->channel_layout = guess_layout_from_channels(fmt_ctx->streams[i]->codecpar->channels);
|
||||
codec_ctx[i]->channel_layout = av_get_default_channel_layout(fmt_ctx->streams[i]->codecpar->channels);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user