footage: fixed appearance of some metadata, particularly audio metadata
This commit is contained in:
@@ -508,7 +508,7 @@ bool FFmpegDecoder::Probe(Footage *f, const QAtomicInt* cancelled)
|
||||
if (error_code == 0) {
|
||||
|
||||
// Retrieve metadata about the media
|
||||
av_dump_format(fmt_ctx_, 0, filename, 0);
|
||||
avformat_find_stream_info(fmt_ctx_, nullptr);
|
||||
|
||||
// Dump it into the Footage object
|
||||
for (unsigned int i=0;i<fmt_ctx_->nb_streams;i++) {
|
||||
|
||||
@@ -22,9 +22,10 @@
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
#include "codec/decoder.h"
|
||||
#include "common/timecodefunctions.h"
|
||||
#include "common/xmlreadloop.h"
|
||||
#include "codec/decoder.h"
|
||||
#include "config/config.h"
|
||||
#include "ui/icons/icons.h"
|
||||
|
||||
Footage::Footage()
|
||||
@@ -235,8 +236,14 @@ QString Footage::duration()
|
||||
} else if (streams_.first()->type() == Stream::kAudio) {
|
||||
AudioStreamPtr audio_stream = std::static_pointer_cast<AudioStream>(streams_.first());
|
||||
|
||||
return Timecode::timestamp_to_timecode(streams_.first()->duration(),
|
||||
streams_.first()->timebase(),
|
||||
// We show audio time in a timecode corresponding to the default sequence frame rate
|
||||
|
||||
rational rtime = Timecode::timestamp_to_time(streams_.first()->duration(), streams_.first()->timebase());
|
||||
|
||||
int64_t time_in_default_tb = Timecode::time_to_timestamp(rtime, Config::Current()["DefaultSequenceFrameRate"].value<rational>());
|
||||
|
||||
return Timecode::timestamp_to_timecode(time_in_default_tb,
|
||||
Config::Current()["DefaultSequenceFrameRate"].value<rational>(),
|
||||
Timecode::CurrentDisplay());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user