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
cc19e760
Commit
cc19e760
authored
Dec 19, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/ffmpeg: use more references
parent
0ff22a16
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
FfmpegDecoderPlugin.cxx
src/decoder/plugins/FfmpegDecoderPlugin.cxx
+11
-11
No files found.
src/decoder/plugins/FfmpegDecoderPlugin.cxx
View file @
cc19e760
...
@@ -321,7 +321,7 @@ ffmpeg_send_packet(Decoder &decoder, InputStream &is,
...
@@ -321,7 +321,7 @@ ffmpeg_send_packet(Decoder &decoder, InputStream &is,
AVPacket
&&
packet
,
AVPacket
&&
packet
,
AVCodecContext
&
codec_context
,
AVCodecContext
&
codec_context
,
const
AVStream
&
stream
,
const
AVStream
&
stream
,
AVFrame
*
frame
,
AVFrame
&
frame
,
uint64_t
min_frame
,
size_t
pcm_frame_size
,
uint64_t
min_frame
,
size_t
pcm_frame_size
,
FfmpegBuffer
&
buffer
)
FfmpegBuffer
&
buffer
)
{
{
...
@@ -346,7 +346,7 @@ ffmpeg_send_packet(Decoder &decoder, InputStream &is,
...
@@ -346,7 +346,7 @@ ffmpeg_send_packet(Decoder &decoder, InputStream &is,
while
(
packet
.
size
>
0
&&
cmd
==
DecoderCommand
::
NONE
)
{
while
(
packet
.
size
>
0
&&
cmd
==
DecoderCommand
::
NONE
)
{
int
got_frame
=
0
;
int
got_frame
=
0
;
int
len
=
avcodec_decode_audio4
(
&
codec_context
,
int
len
=
avcodec_decode_audio4
(
&
codec_context
,
frame
,
&
got_frame
,
&
frame
,
&
got_frame
,
&
packet
);
&
packet
);
if
(
len
<
0
)
{
if
(
len
<
0
)
{
/* if error, we skip the frame */
/* if error, we skip the frame */
...
@@ -357,11 +357,11 @@ ffmpeg_send_packet(Decoder &decoder, InputStream &is,
...
@@ -357,11 +357,11 @@ ffmpeg_send_packet(Decoder &decoder, InputStream &is,
packet
.
data
+=
len
;
packet
.
data
+=
len
;
packet
.
size
-=
len
;
packet
.
size
-=
len
;
if
(
!
got_frame
||
frame
->
nb_samples
<=
0
)
if
(
!
got_frame
||
frame
.
nb_samples
<=
0
)
continue
;
continue
;
auto
output_buffer
=
auto
output_buffer
=
copy_interleave_frame
(
codec_context
,
*
frame
,
copy_interleave_frame
(
codec_context
,
frame
,
buffer
,
error
);
buffer
,
error
);
if
(
output_buffer
.
IsNull
())
{
if
(
output_buffer
.
IsNull
())
{
/* this must be a serious error,
/* this must be a serious error,
...
@@ -394,7 +394,7 @@ ffmpeg_send_packet(Decoder &decoder, InputStream &is,
...
@@ -394,7 +394,7 @@ ffmpeg_send_packet(Decoder &decoder, InputStream &is,
const
AVPacket
&
packet
,
const
AVPacket
&
packet
,
AVCodecContext
&
codec_context
,
AVCodecContext
&
codec_context
,
const
AVStream
&
stream
,
const
AVStream
&
stream
,
AVFrame
*
frame
,
AVFrame
&
frame
,
uint64_t
min_frame
,
size_t
pcm_frame_size
,
uint64_t
min_frame
,
size_t
pcm_frame_size
,
FfmpegBuffer
&
buffer
)
FfmpegBuffer
&
buffer
)
{
{
...
@@ -527,9 +527,9 @@ ffmpeg_decode(Decoder &decoder, InputStream &input)
...
@@ -527,9 +527,9 @@ ffmpeg_decode(Decoder &decoder, InputStream &input)
return
;
return
;
}
}
AVStream
*
av_stream
=
format_context
->
streams
[
audio_stream
];
AVStream
&
av_stream
=
*
format_context
->
streams
[
audio_stream
];
AVCodecContext
*
codec_context
=
av_stream
->
codec
;
AVCodecContext
*
codec_context
=
av_stream
.
codec
;
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 25, 0)
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 25, 0)
const
AVCodecDescriptor
*
codec_descriptor
=
const
AVCodecDescriptor
*
codec_descriptor
=
...
@@ -617,8 +617,8 @@ ffmpeg_decode(Decoder &decoder, InputStream &input)
...
@@ -617,8 +617,8 @@ ffmpeg_decode(Decoder &decoder, InputStream &input)
cmd
=
ffmpeg_send_packet
(
decoder
,
input
,
cmd
=
ffmpeg_send_packet
(
decoder
,
input
,
packet
,
packet
,
*
codec_context
,
*
codec_context
,
*
av_stream
,
av_stream
,
frame
,
*
frame
,
min_frame
,
audio_format
.
GetFrameSize
(),
min_frame
,
audio_format
.
GetFrameSize
(),
interleaved_buffer
);
interleaved_buffer
);
min_frame
=
0
;
min_frame
=
0
;
...
@@ -634,8 +634,8 @@ ffmpeg_decode(Decoder &decoder, InputStream &input)
...
@@ -634,8 +634,8 @@ ffmpeg_decode(Decoder &decoder, InputStream &input)
if
(
cmd
==
DecoderCommand
::
SEEK
)
{
if
(
cmd
==
DecoderCommand
::
SEEK
)
{
int64_t
where
=
int64_t
where
=
ToFfmpegTime
(
decoder_seek_time
(
decoder
),
ToFfmpegTime
(
decoder_seek_time
(
decoder
),
av_stream
->
time_base
)
+
av_stream
.
time_base
)
+
start_time_fallback
(
*
av_stream
);
start_time_fallback
(
av_stream
);
/* AVSEEK_FLAG_BACKWARD asks FFmpeg to seek to
/* AVSEEK_FLAG_BACKWARD asks FFmpeg to seek to
the packet boundary before the seek time
the packet boundary before the seek time
...
...
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