mirror of
https://github.com/owntone/owntone-server.git
synced 2025-04-16 09:08:04 -04:00
[input] Rename player source ->xcode to ->input_ctx, because any input may use it, not just transcode
This commit is contained in:
parent
a183463bb2
commit
f27fb53caf
@ -65,7 +65,13 @@ struct player_source
|
|||||||
end of file, until then it is 0. */
|
end of file, until then it is 0. */
|
||||||
uint64_t end;
|
uint64_t end;
|
||||||
|
|
||||||
struct transcode_ctx *xcode;
|
/* Opaque pointer to data that the input sets up when called with setup(), and
|
||||||
|
* which is cleaned up by the input with stop()
|
||||||
|
*/
|
||||||
|
void *input_ctx;
|
||||||
|
|
||||||
|
/* Input has completed setup of the source
|
||||||
|
*/
|
||||||
int setup_done;
|
int setup_done;
|
||||||
|
|
||||||
struct player_source *play_next;
|
struct player_source *play_next;
|
||||||
|
@ -31,8 +31,8 @@
|
|||||||
static int
|
static int
|
||||||
setup(struct player_source *ps)
|
setup(struct player_source *ps)
|
||||||
{
|
{
|
||||||
ps->xcode = transcode_setup(ps->data_kind, ps->path, ps->len_ms, XCODE_PCM16_NOHEADER, NULL);
|
ps->input_ctx = transcode_setup(ps->data_kind, ps->path, ps->len_ms, XCODE_PCM16_NOHEADER, NULL);
|
||||||
if (!ps->xcode)
|
if (!ps->input_ctx)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
ps->setup_done = 1;
|
ps->setup_done = 1;
|
||||||
@ -70,7 +70,7 @@ start(struct player_source *ps)
|
|||||||
{
|
{
|
||||||
// We set "wanted" to 1 because the read size doesn't matter to us
|
// We set "wanted" to 1 because the read size doesn't matter to us
|
||||||
// TODO optimize?
|
// TODO optimize?
|
||||||
ret = transcode(evbuf, 1, ps->xcode, &icy_timer);
|
ret = transcode(evbuf, 1, ps->input_ctx, &icy_timer);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -90,9 +90,9 @@ start(struct player_source *ps)
|
|||||||
static int
|
static int
|
||||||
stop(struct player_source *ps)
|
stop(struct player_source *ps)
|
||||||
{
|
{
|
||||||
transcode_cleanup(ps->xcode);
|
transcode_cleanup(ps->input_ctx);
|
||||||
|
|
||||||
ps->xcode = NULL;
|
ps->input_ctx = NULL;
|
||||||
ps->setup_done = 0;
|
ps->setup_done = 0;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -101,7 +101,7 @@ stop(struct player_source *ps)
|
|||||||
static int
|
static int
|
||||||
seek(struct player_source *ps, int seek_ms)
|
seek(struct player_source *ps, int seek_ms)
|
||||||
{
|
{
|
||||||
return transcode_seek(ps->xcode, seek_ms);
|
return transcode_seek(ps->input_ctx, seek_ms);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -110,7 +110,7 @@ metadata_get_http(struct input_metadata *metadata, struct player_source *ps, uin
|
|||||||
struct http_icy_metadata *m;
|
struct http_icy_metadata *m;
|
||||||
int changed;
|
int changed;
|
||||||
|
|
||||||
m = transcode_metadata(ps->xcode, &changed);
|
m = transcode_metadata(ps->input_ctx, &changed);
|
||||||
if (!m)
|
if (!m)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user