diff --git a/app/codec/ffmpeg/ffmpegdecoder.cpp b/app/codec/ffmpeg/ffmpegdecoder.cpp index 104c8b24e..6c1c52b98 100644 --- a/app/codec/ffmpeg/ffmpegdecoder.cpp +++ b/app/codec/ffmpeg/ffmpegdecoder.cpp @@ -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;inb_streams;i++) { diff --git a/app/project/item/footage/footage.cpp b/app/project/item/footage/footage.cpp index 180a6ce92..ada2a5e7d 100644 --- a/app/project/item/footage/footage.cpp +++ b/app/project/item/footage/footage.cpp @@ -22,9 +22,10 @@ #include +#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(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()); + + return Timecode::timestamp_to_timecode(time_in_default_tb, + Config::Current()["DefaultSequenceFrameRate"].value(), Timecode::CurrentDisplay()); }