reimplemented UINumeric

This commit is contained in:
itsmattkc
2018-06-20 16:08:33 -07:00
parent 6c0bf62f51
commit 22033d74df
12 changed files with 307 additions and 189 deletions
+11
View File
@@ -1,5 +1,7 @@
#include "media.h"
#include <QDebug>
extern "C" {
#include <libavformat/avformat.h>
}
@@ -22,3 +24,12 @@ Media::~Media() {
long Media::get_length_in_frames(float frame_rate) {
return ceil((float) length / (float) AV_TIME_BASE * frame_rate);
}
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;
}
}