You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
Many Windows related fixes and tweaks. Also fixed some issues with newer versions of CMake and Swig files.
This commit is contained in:
@@ -1218,25 +1218,12 @@ void FFmpegReader::Seek(long int requested_frame) throw(TooManySeeks)
|
||||
{
|
||||
// Seek to nearest key-frame (aka, i-frame)
|
||||
bool seek_worked = false;
|
||||
|
||||
// Seek audio stream (if not already seeked... and if an audio stream is found)
|
||||
int64_t seek_target = ConvertFrameToVideoPTS(requested_frame - buffer_amount);
|
||||
if (!seek_worked && info.has_audio)
|
||||
{
|
||||
seek_target = ConvertFrameToAudioPTS(requested_frame - buffer_amount);
|
||||
|
||||
if (info.has_audio && av_seek_frame(pFormatCtx, info.audio_stream_index, seek_target, AVSEEK_FLAG_BACKWARD) < 0) {
|
||||
fprintf(stderr, "%s: error while seeking audio stream\n", pFormatCtx->filename);
|
||||
} else
|
||||
{
|
||||
// AUDIO SEEK
|
||||
is_video_seek = false;
|
||||
seek_worked = true;
|
||||
}
|
||||
}
|
||||
int64_t seek_target = 0;
|
||||
|
||||
// Seek video stream (if any)
|
||||
if (info.has_video) {
|
||||
if (!seek_worked && info.has_video)
|
||||
{
|
||||
seek_target = ConvertFrameToVideoPTS(requested_frame - buffer_amount);
|
||||
if (av_seek_frame(pFormatCtx, info.video_stream_index, seek_target, AVSEEK_FLAG_BACKWARD) < 0) {
|
||||
fprintf(stderr, "%s: error while seeking video stream\n", pFormatCtx->filename);
|
||||
} else
|
||||
@@ -1247,6 +1234,20 @@ void FFmpegReader::Seek(long int requested_frame) throw(TooManySeeks)
|
||||
}
|
||||
}
|
||||
|
||||
// Seek audio stream (if not already seeked... and if an audio stream is found)
|
||||
if (!seek_worked && info.has_audio)
|
||||
{
|
||||
seek_target = ConvertFrameToAudioPTS(requested_frame - buffer_amount);
|
||||
if (info.has_audio && av_seek_frame(pFormatCtx, info.audio_stream_index, seek_target, AVSEEK_FLAG_BACKWARD) < 0) {
|
||||
fprintf(stderr, "%s: error while seeking audio stream\n", pFormatCtx->filename);
|
||||
} else
|
||||
{
|
||||
// AUDIO SEEK
|
||||
is_video_seek = false;
|
||||
seek_worked = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Was the seek successful?
|
||||
if (seek_worked)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user