Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita35585f

Browse files
author
Clement Champetier
committed
hotfix: InputFile::seek at the exact frame
Update documentation of InputFile::seekxxx functions.
1 parent5fb1558 commita35585f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

‎src/AvTranscoder/file/InputFile.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,13 @@ bool InputFile::readNextPacket( CodedData& data, const size_t streamIndex )
8686
voidInputFile::seekAtFrame(constsize_t frame )
8787
{
8888
uint64_t position = frame /getFps() * AV_TIME_BASE;
89-
_formatContext.seek( position,AVSEEK_FLAG_BACKWARD );
89+
_formatContext.seek( position,AVSEEK_FLAG_ANY );
9090
}
9191

9292
voidInputFile::seekAtTime(constdouble time )
9393
{
9494
uint64_t position = time * AV_TIME_BASE;
95-
_formatContext.seek( position,AVSEEK_FLAG_BACKWARD );
95+
_formatContext.seek( position,AVSEEK_FLAG_ANY );
9696
}
9797

9898
voidInputFile::activateStream(constsize_t streamIndex,bool activate )

‎src/AvTranscoder/file/InputFile.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ class AvExport InputFile
4848
boolreadNextPacket( CodedData& data,constsize_t streamIndex );
4949

5050
/**
51-
* @brief Seekinput streamatspecifiedframe
52-
* @noteclean also buffers in each InputStream
53-
* @return if next packet was read succefully
51+
* @brief Seek ata specificframe / time (in seconds)
52+
* @noteSeek in file by using the default stream (according to ffmpeg)
53+
* @warning If the seek is done to a non key-frame, the decoding will start from the next key-frame
5454
**/
5555
voidseekAtFrame(constsize_t frame );
5656
voidseekAtTime(constdouble time );

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp