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
f804a739
Commit
f804a739
authored
Sep 15, 2011
by
Max Kellermann
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v0.16.x'
Conflicts: NEWS configure.ac
parents
8751783a
2ed870c8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
11 deletions
+44
-11
NEWS
NEWS
+9
-0
ffmpeg_decoder_plugin.c
src/decoder/ffmpeg_decoder_plugin.c
+30
-8
rewind_input_plugin.c
src/input/rewind_input_plugin.c
+3
-1
pcm_format.c
src/pcm_format.c
+2
-2
No files found.
NEWS
View file @
f804a739
...
...
@@ -21,6 +21,15 @@ ver 0.17 (2011/??/??)
* cue: show CUE track numbers
ver 0.16.5 (2010/??/??)
* pcm_format: fix 32-to-24 bit conversion (the "silence" bug)
* input:
- rewind: reduce heap usage
* decoder:
- ffmpeg: higher precision timestamps
- ffmpeg: don't require key frame for seeking
ver 0.16.4 (2011/09/01)
* don't abort configure when avahi is not found
* auto-detect libmad without pkg-config
...
...
src/decoder/ffmpeg_decoder_plugin.c
View file @
f804a739
...
...
@@ -211,6 +211,24 @@ align16(void *p, size_t *length_p)
return
(
char
*
)
p
+
add
;
}
G_GNUC_CONST
static
double
time_from_ffmpeg
(
int64_t
t
,
const
AVRational
time_base
)
{
assert
(
t
!=
(
int64_t
)
AV_NOPTS_VALUE
);
return
(
double
)
av_rescale_q
(
t
,
time_base
,
(
AVRational
){
1
,
1024
})
/
(
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
,
...
...
@@ -219,8 +237,7 @@ ffmpeg_send_packet(struct decoder *decoder, struct input_stream *is,
{
if
(
packet
->
pts
!=
(
int64_t
)
AV_NOPTS_VALUE
)
decoder_timestamp
(
decoder
,
av_rescale_q
(
packet
->
pts
,
*
time_base
,
(
AVRational
){
1
,
1
}));
time_from_ffmpeg
(
packet
->
pts
,
*
time_base
));
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52,25,0)
AVPacket
packet2
=
*
packet
;
...
...
@@ -367,8 +384,9 @@ ffmpeg_decode(struct decoder *decoder, struct input_stream *input)
return
;
}
AVCodecContext
*
codec_context
=
format_context
->
streams
[
audio_stream
]
->
codec
;
AVStream
*
av_stream
=
format_context
->
streams
[
audio_stream
];
AVCodecContext
*
codec_context
=
av_stream
->
codec
;
if
(
codec_context
->
codec_name
[
0
]
!=
0
)
g_debug
(
"codec '%s'"
,
codec_context
->
codec_name
);
...
...
@@ -419,7 +437,7 @@ ffmpeg_decode(struct decoder *decoder, struct input_stream *input)
if
(
packet
.
stream_index
==
audio_stream
)
cmd
=
ffmpeg_send_packet
(
decoder
,
input
,
&
packet
,
codec_context
,
&
format_context
->
streams
[
audio_stream
]
->
time_base
);
&
av_stream
->
time_base
);
else
cmd
=
decoder_get_command
(
decoder
);
...
...
@@ -427,12 +445,16 @@ 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
,
0
)
<
0
)
if
(
av_seek_frame
(
format_context
,
audio_stream
,
where
,
AV_TIME_BASE
)
<
0
)
decoder_seek_error
(
decoder
);
else
else
{
avcodec_flush_buffers
(
codec_context
);
decoder_command_finished
(
decoder
);
}
}
}
while
(
cmd
!=
DECODE_COMMAND_STOP
);
...
...
src/input/rewind_input_plugin.c
View file @
f804a739
...
...
@@ -83,12 +83,14 @@ copy_attributes(struct input_rewind *r)
assert
(
dest
!=
src
);
assert
(
src
->
mime
==
NULL
||
dest
->
mime
!=
src
->
mime
);
bool
dest_ready
=
dest
->
ready
;
dest
->
ready
=
src
->
ready
;
dest
->
seekable
=
src
->
seekable
;
dest
->
size
=
src
->
size
;
dest
->
offset
=
src
->
offset
;
if
(
src
->
mime
!=
NULL
)
{
if
(
!
dest_ready
&&
src
->
ready
)
{
g_free
(
dest
->
mime
);
dest
->
mime
=
g_strdup
(
src
->
mime
);
}
...
...
src/pcm_format.c
View file @
f804a739
...
...
@@ -143,7 +143,7 @@ pcm_convert_16_to_24(int32_t *out, const int16_t *in,
}
static
void
pcm_convert_32_to_24
(
int32_t
*
out
,
const
int
16
_t
*
in
,
pcm_convert_32_to_24
(
int32_t
*
out
,
const
int
32
_t
*
in
,
unsigned
num_samples
)
{
while
(
num_samples
>
0
)
{
...
...
@@ -197,7 +197,7 @@ pcm_convert_to_24(struct pcm_buffer *buffer,
*
dest_size_r
=
num_samples
*
sizeof
(
*
dest
);
dest
=
pcm_buffer_get
(
buffer
,
*
dest_size_r
);
pcm_convert_32_to_24
(
dest
,
(
const
int
16
_t
*
)
src
,
pcm_convert_32_to_24
(
dest
,
(
const
int
32
_t
*
)
src
,
num_samples
);
return
dest
;
}
...
...
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