extremely limited speed support implemented #120

This commit is contained in:
itsmattkc
2018-10-01 14:51:36 +10:00
parent c21a21c219
commit ac153e4cff
14 changed files with 143 additions and 91 deletions
-9
View File
@@ -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;
}
}
-2
View File
@@ -50,6 +50,4 @@ struct Media {
void reset();
};
int guess_layout_from_channels(int channel_count);
#endif // MEDIA_H
+1 -1
View File
@@ -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);
}
}
}