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
adbe8c40
Commit
adbe8c40
authored
Oct 01, 2012
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output/{recorder,shout}: call encoder_read() in a loop
This is necessary for Ogg packets that span more than one page.
parent
58e600f4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
16 deletions
+24
-16
NEWS
NEWS
+1
-0
encoder_plugin.h
src/encoder_plugin.h
+2
-0
recorder_output_plugin.c
src/output/recorder_output_plugin.c
+11
-8
shout_output_plugin.c
src/output/shout_output_plugin.c
+10
-8
No files found.
NEWS
View file @
adbe8c40
...
...
@@ -2,6 +2,7 @@ ver 0.17.3 (2012/??/??)
* output:
- recorder: fix I/O error check
- shout: fix memory leak in error handler
- recorder, shout: support Ogg packets that span more than one page
ver 0.17.2 (2012/09/30)
* protocol:
...
...
src/encoder_plugin.h
View file @
adbe8c40
...
...
@@ -295,6 +295,8 @@ encoder_write(struct encoder *encoder, const void *data, size_t length,
/**
* Reads encoded data from the encoder.
*
* Call this repeatedly until no more data is returned.
*
* @param encoder the encoder
* @param dest the destination buffer to copy to
* @param length the maximum length of the destination buffer
...
...
src/output/recorder_output_plugin.c
View file @
adbe8c40
...
...
@@ -160,17 +160,20 @@ recorder_output_encoder_to_file(struct recorder_output *recorder,
{
assert
(
recorder
->
fd
>=
0
);
/* read from the encoder */
while
(
true
)
{
/* read from the encoder */
size_t
size
=
encoder_read
(
recorder
->
encoder
,
recorder
->
buffer
,
sizeof
(
recorder
->
buffer
));
if
(
size
==
0
)
return
true
;
size_t
size
=
encoder_read
(
recorder
->
encoder
,
recorder
->
buffer
,
sizeof
(
recorder
->
buffer
));
if
(
size
==
0
)
return
true
;
/* write everything into the file */
/* write everything into the file */
return
recorder_write_to_file
(
recorder
,
recorder
->
buffer
,
size
,
error_r
);
if
(
!
recorder_write_to_file
(
recorder
,
recorder
->
buffer
,
size
,
error_r
))
return
false
;
}
}
static
bool
...
...
src/output/shout_output_plugin.c
View file @
adbe8c40
...
...
@@ -342,14 +342,16 @@ write_page(struct shout_data *sd, GError **error)
{
assert
(
sd
->
encoder
!=
NULL
);
size_t
nbytes
=
encoder_read
(
sd
->
encoder
,
sd
->
buffer
,
sizeof
(
sd
->
buffer
));
if
(
nbytes
==
0
)
return
true
;
int
err
=
shout_send
(
sd
->
shout_conn
,
sd
->
buffer
,
nbytes
);
if
(
!
handle_shout_error
(
sd
,
err
,
error
))
return
false
;
while
(
true
)
{
size_t
nbytes
=
encoder_read
(
sd
->
encoder
,
sd
->
buffer
,
sizeof
(
sd
->
buffer
));
if
(
nbytes
==
0
)
return
true
;
int
err
=
shout_send
(
sd
->
shout_conn
,
sd
->
buffer
,
nbytes
);
if
(
!
handle_shout_error
(
sd
,
err
,
error
))
return
false
;
}
return
true
;
}
...
...
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