Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
ce35ba9a
Commit
ce35ba9a
authored
13 years ago
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/ffmpeg: explicitly specify the current stream for seeking
Use AVStream.time_base to convert the decoder_seek_where() value, and pass the current stream number to av_seek_frame().
parent
724a59aa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
ffmpeg_decoder_plugin.c
src/decoder/ffmpeg_decoder_plugin.c
+11
-2
No files found.
src/decoder/ffmpeg_decoder_plugin.c
View file @
ce35ba9a
...
...
@@ -224,6 +224,14 @@ time_from_ffmpeg(int64_t t, const AVRational time_base)
/
(
double
)
1024
;
}
G_GNUC_CONST
static
int64_t
time_to_ffmpeg
(
double
t
,
const
AVRational
time_base
)
{
return
av_rescale_q
((
int64_t
)(
t
*
1024
),
(
AVRational
){
1
,
1024
},
time_base
);
}
static
enum
decoder_command
ffmpeg_send_packet
(
struct
decoder
*
decoder
,
struct
input_stream
*
is
,
const
AVPacket
*
packet
,
...
...
@@ -445,9 +453,10 @@ ffmpeg_decode(struct decoder *decoder, struct input_stream *input)
if
(
cmd
==
DECODE_COMMAND_SEEK
)
{
int64_t
where
=
decoder_seek_where
(
decoder
)
*
AV_TIME_BASE
;
time_to_ffmpeg
(
decoder_seek_where
(
decoder
),
av_stream
->
time_base
);
if
(
av_seek_frame
(
format_context
,
-
1
,
where
,
if
(
av_seek_frame
(
format_context
,
audio_stream
,
where
,
AV_TIME_BASE
)
<
0
)
decoder_seek_error
(
decoder
);
else
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment