reimplemented UINumeric
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user