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
90e7ace9
Commit
90e7ace9
authored
Jun 21, 2015
by
Max Kellermann
Browse files
Options
Browse Files
Download
Plain Diff
Merge tag 'v0.19.10'
parents
2b0a127f
b0ff3bc7
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
107 additions
and
15 deletions
+107
-15
NEWS
NEWS
+15
-0
PlayerThread.cxx
src/PlayerThread.cxx
+6
-0
DecoderAPI.cxx
src/decoder/DecoderAPI.cxx
+5
-2
DecoderThread.cxx
src/decoder/DecoderThread.cxx
+5
-1
FfmpegDecoderPlugin.cxx
src/decoder/plugins/FfmpegDecoderPlugin.cxx
+67
-7
OpusEncoderPlugin.cxx
src/encoder/plugins/OpusEncoderPlugin.cxx
+1
-1
CurlInputPlugin.cxx
src/input/plugins/CurlInputPlugin.cxx
+2
-0
SmbclientInputPlugin.cxx
src/input/plugins/SmbclientInputPlugin.cxx
+1
-0
OutputControl.cxx
src/output/OutputControl.cxx
+2
-1
NfsStorage.cxx
src/storage/plugins/NfsStorage.cxx
+2
-2
PeriodClock.hxx
src/system/PeriodClock.hxx
+1
-1
No files found.
NEWS
View file @
90e7ace9
...
@@ -30,6 +30,21 @@ ver 0.20 (not yet released)
...
@@ -30,6 +30,21 @@ ver 0.20 (not yet released)
* database
* database
- proxy: add TCP keepalive option
- proxy: add TCP keepalive option
ver 0.19.10 (2015/06/21)
* input
- curl: fix deadlock on small responses
- smbclient: fix DFF playback
* decoder
- ffmpeg: improve seeking accuracy
- fix stuck stream tags
* encoder
- opus: fix bogus granulepos
* output
- fix failure to open device right after booting
* neighbor
- nfs: fix deadlock when connecting
* fix "single" mode breakage due to queue edits
ver 0.19.9 (2015/02/06)
ver 0.19.9 (2015/02/06)
* decoder
* decoder
- dsdiff, dsf: raise ID3 tag limit to 1 MB
- dsdiff, dsf: raise ID3 tag limit to 1 MB
...
...
src/PlayerThread.cxx
View file @
90e7ace9
...
@@ -612,6 +612,12 @@ Player::ProcessCommand()
...
@@ -612,6 +612,12 @@ Player::ProcessCommand()
queued
=
true
;
queued
=
true
;
pc
.
CommandFinished
();
pc
.
CommandFinished
();
pc
.
Unlock
();
if
(
dc
.
LockIsIdle
())
StartDecoder
(
*
new
MusicPipe
());
pc
.
Lock
();
break
;
break
;
case
PlayerCommand
:
:
PAUSE
:
case
PlayerCommand
:
:
PAUSE
:
...
...
src/decoder/DecoderAPI.cxx
View file @
90e7ace9
...
@@ -433,8 +433,11 @@ update_stream_tag(Decoder &decoder, InputStream *is)
...
@@ -433,8 +433,11 @@ update_stream_tag(Decoder &decoder, InputStream *is)
/* no stream tag present - submit the song tag
/* no stream tag present - submit the song tag
instead */
instead */
}
else
/* discard the song tag; we don't need it */
delete
decoder
.
song_tag
;
decoder
.
song_tag
=
nullptr
;
decoder
.
song_tag
=
nullptr
;
}
delete
decoder
.
stream_tag
;
delete
decoder
.
stream_tag
;
decoder
.
stream_tag
=
tag
;
decoder
.
stream_tag
=
tag
;
...
@@ -566,7 +569,7 @@ decoder_tag(Decoder &decoder, InputStream *is,
...
@@ -566,7 +569,7 @@ decoder_tag(Decoder &decoder, InputStream *is,
/* save the tag */
/* save the tag */
delete
decoder
.
decoder_tag
;
delete
decoder
.
decoder_tag
;
decoder
.
decoder_tag
=
new
Tag
(
tag
);
decoder
.
decoder_tag
=
new
Tag
(
std
::
move
(
tag
)
);
/* check for a new stream tag */
/* check for a new stream tag */
...
...
src/decoder/DecoderThread.cxx
View file @
90e7ace9
...
@@ -378,7 +378,11 @@ decoder_run_song(DecoderControl &dc,
...
@@ -378,7 +378,11 @@ decoder_run_song(DecoderControl &dc,
const
DetachedSong
&
song
,
const
char
*
uri
,
Path
path_fs
)
const
DetachedSong
&
song
,
const
char
*
uri
,
Path
path_fs
)
{
{
Decoder
decoder
(
dc
,
dc
.
start_time
.
IsPositive
(),
Decoder
decoder
(
dc
,
dc
.
start_time
.
IsPositive
(),
new
Tag
(
song
.
GetTag
()));
/* pass the song tag only if it's
authoritative, i.e. if it's a local file -
tags on "stream" songs are just remembered
from the last time we played it*/
song
.
IsFile
()
?
new
Tag
(
song
.
GetTag
())
:
nullptr
);
dc
.
state
=
DecoderState
::
START
;
dc
.
state
=
DecoderState
::
START
;
...
...
src/decoder/plugins/FfmpegDecoderPlugin.cxx
View file @
90e7ace9
...
@@ -163,8 +163,40 @@ copy_interleave_frame(const AVCodecContext &codec_context,
...
@@ -163,8 +163,40 @@ copy_interleave_frame(const AVCodecContext &codec_context,
}
}
/**
/**
* Convert AVPacket::pts to a stream-relative time stamp (still in
* AVStream::time_base units). Returns a negative value on error.
*/
gcc_pure
static
int64_t
StreamRelativePts
(
const
AVPacket
&
packet
,
const
AVStream
&
stream
)
{
auto
pts
=
packet
.
pts
;
if
(
pts
<
0
||
pts
==
int64_t
(
AV_NOPTS_VALUE
))
return
-
1
;
auto
start
=
start_time_fallback
(
stream
);
return
pts
-
start
;
}
/**
* Convert a non-negative stream-relative time stamp in
* AVStream::time_base units to a PCM frame number.
*/
gcc_pure
static
uint64_t
PtsToPcmFrame
(
uint64_t
pts
,
const
AVStream
&
stream
,
const
AVCodecContext
&
codec_context
)
{
return
av_rescale_q
(
pts
,
stream
.
time_base
,
codec_context
.
time_base
);
}
/**
* Decode an #AVPacket and send the resulting PCM data to the decoder
* Decode an #AVPacket and send the resulting PCM data to the decoder
* API.
* API.
*
* @param min_frame skip all data before this PCM frame number; this
* is used after seeking to skip data in an AVPacket until the exact
* desired time stamp has been reached
*/
*/
static
DecoderCommand
static
DecoderCommand
ffmpeg_send_packet
(
Decoder
&
decoder
,
InputStream
&
is
,
ffmpeg_send_packet
(
Decoder
&
decoder
,
InputStream
&
is
,
...
@@ -172,13 +204,21 @@ ffmpeg_send_packet(Decoder &decoder, InputStream &is,
...
@@ -172,13 +204,21 @@ ffmpeg_send_packet(Decoder &decoder, InputStream &is,
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
,
FfmpegBuffer
&
buffer
)
FfmpegBuffer
&
buffer
)
{
{
if
(
packet
.
pts
>=
0
&&
packet
.
pts
!=
(
int64_t
)
AV_NOPTS_VALUE
)
{
size_t
skip_bytes
=
0
;
auto
start
=
start_time_fallback
(
stream
);
if
(
packet
.
pts
>=
start
)
const
auto
pts
=
StreamRelativePts
(
packet
,
stream
);
if
(
pts
>=
0
)
{
if
(
min_frame
>
0
)
{
auto
cur_frame
=
PtsToPcmFrame
(
pts
,
stream
,
codec_context
);
if
(
cur_frame
<
min_frame
)
skip_bytes
=
pcm_frame_size
*
(
min_frame
-
cur_frame
);
}
else
decoder_timestamp
(
decoder
,
decoder_timestamp
(
decoder
,
FfmpegTimeToDouble
(
p
acket
.
pts
-
start
,
FfmpegTimeToDouble
(
p
ts
,
stream
.
time_base
));
stream
.
time_base
));
}
}
...
@@ -212,6 +252,18 @@ ffmpeg_send_packet(Decoder &decoder, InputStream &is,
...
@@ -212,6 +252,18 @@ ffmpeg_send_packet(Decoder &decoder, InputStream &is,
return
DecoderCommand
::
STOP
;
return
DecoderCommand
::
STOP
;
}
}
if
(
skip_bytes
>
0
)
{
if
(
skip_bytes
>=
output_buffer
.
size
)
{
skip_bytes
-=
output_buffer
.
size
;
continue
;
}
output_buffer
.
data
=
(
const
uint8_t
*
)
output_buffer
.
data
+
skip_bytes
;
output_buffer
.
size
-=
skip_bytes
;
skip_bytes
=
0
;
}
cmd
=
decoder_data
(
decoder
,
is
,
cmd
=
decoder_data
(
decoder
,
is
,
output_buffer
.
data
,
output_buffer
.
size
,
output_buffer
.
data
,
output_buffer
.
size
,
codec_context
.
bit_rate
/
1000
);
codec_context
.
bit_rate
/
1000
);
...
@@ -489,6 +541,8 @@ FfmpegDecode(Decoder &decoder, InputStream &input,
...
@@ -489,6 +541,8 @@ FfmpegDecode(Decoder &decoder, InputStream &input,
FfmpegBuffer
interleaved_buffer
;
FfmpegBuffer
interleaved_buffer
;
uint64_t
min_frame
=
0
;
DecoderCommand
cmd
;
DecoderCommand
cmd
;
do
{
do
{
AVPacket
packet
;
AVPacket
packet
;
...
@@ -500,13 +554,15 @@ FfmpegDecode(Decoder &decoder, InputStream &input,
...
@@ -500,13 +554,15 @@ FfmpegDecode(Decoder &decoder, InputStream &input,
FfmpegCheckTag
(
decoder
,
input
,
format_context
,
audio_stream
);
FfmpegCheckTag
(
decoder
,
input
,
format_context
,
audio_stream
);
#endif
#endif
if
(
packet
.
stream_index
==
audio_stream
)
if
(
packet
.
stream_index
==
audio_stream
)
{
cmd
=
ffmpeg_send_packet
(
decoder
,
input
,
cmd
=
ffmpeg_send_packet
(
decoder
,
input
,
packet
,
codec_context
,
packet
,
codec_context
,
av_stream
,
av_stream
,
*
frame
,
*
frame
,
min_frame
,
audio_format
.
GetFrameSize
(),
interleaved_buffer
);
interleaved_buffer
);
else
min_frame
=
0
;
}
else
cmd
=
decoder_get_command
(
decoder
);
cmd
=
decoder_get_command
(
decoder
);
av_free_packet
(
&
packet
);
av_free_packet
(
&
packet
);
...
@@ -517,11 +573,15 @@ FfmpegDecode(Decoder &decoder, InputStream &input,
...
@@ -517,11 +573,15 @@ FfmpegDecode(Decoder &decoder, InputStream &input,
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
the packet boundary before the seek time
stamp, not after */
if
(
av_seek_frame
(
&
format_context
,
audio_stream
,
where
,
if
(
av_seek_frame
(
&
format_context
,
audio_stream
,
where
,
AVSEEK_FLAG_ANY
)
<
0
)
AVSEEK_FLAG_ANY
|
AVSEEK_FLAG_BACKWARD
)
<
0
)
decoder_seek_error
(
decoder
);
decoder_seek_error
(
decoder
);
else
{
else
{
avcodec_flush_buffers
(
&
codec_context
);
avcodec_flush_buffers
(
&
codec_context
);
min_frame
=
decoder_seek_where_frame
(
decoder
);
decoder_command_finished
(
decoder
);
decoder_command_finished
(
decoder
);
}
}
}
}
...
...
src/encoder/plugins/OpusEncoderPlugin.cxx
View file @
90e7ace9
...
@@ -66,7 +66,7 @@ struct opus_encoder {
...
@@ -66,7 +66,7 @@ struct opus_encoder {
ogg_int64_t
granulepos
;
ogg_int64_t
granulepos
;
opus_encoder
()
:
encoder
(
opus_encoder_plugin
)
{}
opus_encoder
()
:
encoder
(
opus_encoder_plugin
)
,
granulepos
(
0
)
{}
};
};
static
constexpr
Domain
opus_encoder_domain
(
"opus_encoder"
);
static
constexpr
Domain
opus_encoder_domain
(
"opus_encoder"
);
...
...
src/input/plugins/CurlInputPlugin.cxx
View file @
90e7ace9
...
@@ -453,6 +453,8 @@ CurlInputStream::RequestDone(CURLcode result, long status)
...
@@ -453,6 +453,8 @@ CurlInputStream::RequestDone(CURLcode result, long status)
SeekDone
();
SeekDone
();
else
if
(
!
IsReady
())
else
if
(
!
IsReady
())
SetReady
();
SetReady
();
else
cond
.
broadcast
();
}
}
static
void
static
void
...
...
src/input/plugins/SmbclientInputPlugin.cxx
View file @
90e7ace9
...
@@ -132,6 +132,7 @@ SmbclientInputStream::Read(void *ptr, size_t read_size, Error &error)
...
@@ -132,6 +132,7 @@ SmbclientInputStream::Read(void *ptr, size_t read_size, Error &error)
nbytes
=
0
;
nbytes
=
0
;
}
}
offset
+=
nbytes
;
return
nbytes
;
return
nbytes
;
}
}
...
...
src/output/OutputControl.cxx
View file @
90e7ace9
...
@@ -186,7 +186,8 @@ AudioOutput::LockUpdate(const AudioFormat audio_format,
...
@@ -186,7 +186,8 @@ AudioOutput::LockUpdate(const AudioFormat audio_format,
const
ScopeLock
protect
(
mutex
);
const
ScopeLock
protect
(
mutex
);
if
(
enabled
&&
really_enabled
)
{
if
(
enabled
&&
really_enabled
)
{
if
(
fail_timer
.
Check
(
REOPEN_AFTER
*
1000
))
{
if
(
!
fail_timer
.
IsDefined
()
||
fail_timer
.
Check
(
REOPEN_AFTER
*
1000
))
{
return
Open
(
audio_format
,
mp
);
return
Open
(
audio_format
,
mp
);
}
}
}
else
if
(
IsOpen
())
}
else
if
(
IsOpen
())
...
...
src/storage/plugins/NfsStorage.cxx
View file @
90e7ace9
...
@@ -177,6 +177,8 @@ private:
...
@@ -177,6 +177,8 @@ private:
mutex
.
unlock
();
mutex
.
unlock
();
DeferredMonitor
::
Schedule
();
DeferredMonitor
::
Schedule
();
mutex
.
lock
();
mutex
.
lock
();
if
(
state
==
State
::
INITIAL
)
cond
.
wait
(
mutex
);
break
;
break
;
case
State
:
:
CONNECTING
:
case
State
:
:
CONNECTING
:
...
@@ -188,8 +190,6 @@ private:
...
@@ -188,8 +190,6 @@ private:
error
.
Set
(
last_error
);
error
.
Set
(
last_error
);
return
false
;
return
false
;
}
}
cond
.
wait
(
mutex
);
}
}
}
}
...
...
src/system/PeriodClock.hxx
View file @
90e7ace9
...
@@ -63,7 +63,7 @@ protected:
...
@@ -63,7 +63,7 @@ protected:
}
}
public
:
public
:
bool
IsDefined
()
const
{
constexpr
bool
IsDefined
()
const
{
return
last
!=
0
;
return
last
!=
0
;
}
}
...
...
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