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
33faf981
Commit
33faf981
authored
May 19, 2004
by
Warren Dukes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix a nasty bug when deleting a stream from the playlist
git-svn-id:
https://svn.musicpd.org/mpd/trunk@1082
09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent
ef8209e1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
7 deletions
+14
-7
directory.c
src/directory.c
+1
-1
playlist.c
src/playlist.c
+11
-4
song.h
src/song.h
+2
-2
No files found.
src/directory.c
View file @
33faf981
...
...
@@ -1229,7 +1229,7 @@ void initMp3Directory() {
Song
*
getSongDetails
(
char
*
file
,
char
**
shortnameRet
,
Directory
**
directoryRet
)
{
void
*
song
;
void
*
song
=
NULL
;
Directory
*
directory
;
char
*
dir
=
NULL
;
char
*
dup
=
strdup
(
file
);
...
...
src/playlist.c
View file @
33faf981
...
...
@@ -138,6 +138,12 @@ void initPlaylist() {
}
void
finishPlaylist
()
{
int
i
;
for
(
i
=
0
;
i
<
playlist
.
length
;
i
++
)
{
if
(
playlist
.
songs
[
i
]
->
type
==
SONG_TYPE_URL
)
{
/*freeJustSong(playlist.songs[i]);*/
}
}
free
(
playlist
.
songs
);
playlist
.
songs
=
NULL
;
free
(
playlist
.
order
);
...
...
@@ -151,7 +157,7 @@ int clearPlaylist(FILE * fp) {
for
(
i
=
0
;
i
<
playlist
.
length
;
i
++
)
{
if
(
playlist
.
songs
[
i
]
->
type
==
SONG_TYPE_URL
)
{
free
(
playlist
.
songs
[
i
]);
/*freeJustSong(playlist.songs[i]);*/
}
playlist
.
songs
[
i
]
=
NULL
;
}
...
...
@@ -584,6 +590,10 @@ int deleteFromPlaylist(FILE * fp, int song) {
}
}
if
(
playlist
.
songs
[
song
]
->
type
==
SONG_TYPE_URL
)
{
freeJustSong
(
playlist
.
songs
[
song
]);
}
/* delete song from songs array */
for
(
i
=
song
;
i
<
playlist
.
length
-
1
;
i
++
)
{
playlist
.
songs
[
i
]
=
playlist
.
songs
[
i
+
1
];
...
...
@@ -600,9 +610,6 @@ int deleteFromPlaylist(FILE * fp, int song) {
if
(
playlist
.
order
[
i
]
>
song
)
playlist
.
order
[
i
]
--
;
}
/* now take care of other misc stuff */
if
(
playlist
.
songs
[
playlist
.
length
-
1
]
->
type
==
SONG_TYPE_URL
)
{
freeJustSong
(
playlist
.
songs
[
playlist
.
length
-
1
]);
}
playlist
.
songs
[
playlist
.
length
-
1
]
=
NULL
;
playlist
.
length
--
;
...
...
src/song.h
View file @
33faf981
...
...
@@ -31,8 +31,8 @@
#include "list.h"
typedef
enum
{
SONG_TYPE_FILE
,
SONG_TYPE_URL
SONG_TYPE_FILE
=
1
,
SONG_TYPE_URL
=
2
}
SONG_TYPE
;
typedef
struct
_Song
{
...
...
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