summaryrefslogtreecommitdiff
path: root/apps/plugins/mpegplayer/stream_thread.h
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2010-05-17 12:34:05 +0000
committerMichael Sevakis <jethead71@rockbox.org>2010-05-17 12:34:05 +0000
commitfcf36dd4f9879a82342e5606535d2dcf46d1de2a (patch)
tree21ed249c7a6f9d0bd7e2049c7a9f9e0708ba28f8 /apps/plugins/mpegplayer/stream_thread.h
parent9fde12676b382a31a10c58e2473edfde460e4d73 (diff)
downloadrockbox-fcf36dd4f9879a82342e5606535d2dcf46d1de2a.tar.gz
rockbox-fcf36dd4f9879a82342e5606535d2dcf46d1de2a.zip
Simplify mpegplayer a bit and use array-based lists rather than linked lists for stream management. Move a couple useful functions to handle pointer arrays from kernel.c into general.c; mpeglayer now makes use of them.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26101 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/mpegplayer/stream_thread.h')
-rw-r--r--apps/plugins/mpegplayer/stream_thread.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/apps/plugins/mpegplayer/stream_thread.h b/apps/plugins/mpegplayer/stream_thread.h
index 30bf46e6ff..1d3a445735 100644
--- a/apps/plugins/mpegplayer/stream_thread.h
+++ b/apps/plugins/mpegplayer/stream_thread.h
@@ -39,7 +39,6 @@ struct stream_hdr
39 off_t pos; /* Start/current position for random-access read */ 39 off_t pos; /* Start/current position for random-access read */
40 }; 40 };
41 off_t limit; /* Limit for random-access read */ 41 off_t limit; /* Limit for random-access read */
42 struct list_item nf; /* List for data notification */
43}; 42};
44 43
45struct stream 44struct stream
@@ -48,8 +47,6 @@ struct stream
48 unsigned int thread; /* Stream's thread */ 47 unsigned int thread; /* Stream's thread */
49 uint8_t* curr_packet; /* Current stream packet beginning */ 48 uint8_t* curr_packet; /* Current stream packet beginning */
50 uint8_t* curr_packet_end; /* Current stream packet end */ 49 uint8_t* curr_packet_end; /* Current stream packet end */
51 struct list_item l; /* List of streams - either reserve pool
52 or active pool */
53 int state; /* State machine parsing mode */ 50 int state; /* State machine parsing mode */
54 uint32_t start_pts; /* First timestamp for stream */ 51 uint32_t start_pts; /* First timestamp for stream */
55 uint32_t end_pts; /* Last timestamp for stream */ 52 uint32_t end_pts; /* Last timestamp for stream */
@@ -58,6 +55,8 @@ struct stream
58 unsigned id; /* Stream identifier */ 55 unsigned id; /* Stream identifier */
59}; 56};
60 57
58#define STR_FROM_HDR(sh) ((struct stream *)(sh))
59
61/* Make sure there there is always enough data buffered ahead for 60/* Make sure there there is always enough data buffered ahead for
62 * the worst possible case - regardless of whether a valid stream 61 * the worst possible case - regardless of whether a valid stream
63 * would actually produce that */ 62 * would actually produce that */
@@ -145,8 +144,6 @@ enum stream_status
145 STREAM_NOT_FOUND, /* Match not found */ 144 STREAM_NOT_FOUND, /* Match not found */
146}; 145};
147 146
148#define STR_FROM_HEADER(sh) ((struct stream *)(sh))
149
150/* Clip time to range for a particular stream */ 147/* Clip time to range for a particular stream */
151static inline uint32_t clip_time(struct stream *str, uint32_t time) 148static inline uint32_t clip_time(struct stream *str, uint32_t time)
152{ 149{