diff options
| author | Teruaki Kawashima <teru@rockbox.org> | 2010-01-13 12:55:52 +0000 |
|---|---|---|
| committer | Teruaki Kawashima <teru@rockbox.org> | 2010-01-13 12:55:52 +0000 |
| commit | ead28e174ebb32d6a6aebf780b5884a529ef4598 (patch) | |
| tree | 567cc8b7385471b24f10be95ee0afb84b74a8ef1 /apps/plugins/mpegplayer/mpeg_parser.c | |
| parent | a1b97086c5a19e1035f32a6486b00aeb559ba0bb (diff) | |
| download | rockbox-ead28e174ebb32d6a6aebf780b5884a529ef4598.zip rockbox-ead28e174ebb32d6a6aebf780b5884a529ef4598.tar.gz rockbox-ead28e174ebb32d6a6aebf780b5884a529ef4598.tar.bz2 rockbox-ead28e174ebb32d6a6aebf780b5884a529ef4598.tar.xz | |
mpegplayer:
* use upper case for enum constants.
* rename MPEG_START_TIME_SCROLL_DOWN/SCROLL_UP to MPEG_START_TIME_LEFT2/RIGHT2 as they are equivalent to MPEG_START_TIME_LEFT/RIGHT.
* simplify some code. no functional changes.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24224 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/mpegplayer/mpeg_parser.c')
| -rw-r--r-- | apps/plugins/mpegplayer/mpeg_parser.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/apps/plugins/mpegplayer/mpeg_parser.c b/apps/plugins/mpegplayer/mpeg_parser.c index 30793e0..e14c513 100644 --- a/apps/plugins/mpegplayer/mpeg_parser.c +++ b/apps/plugins/mpegplayer/mpeg_parser.c @@ -354,7 +354,7 @@ static off_t mpeg_parser_seek_PTS(uint32_t time, unsigned id) uint32_t time_right = str_parser.end_pts; uint32_t pts = 0; uint32_t prevpts = 0; - enum state_enum state = state0; + enum state_enum state = STATE0; struct stream_scan sk; /* Initial estimate taken from average bitrate - later interpolations are @@ -372,7 +372,7 @@ static off_t mpeg_parser_seek_PTS(uint32_t time, unsigned id) sk.dir = SSCAN_REVERSE; - while (state < state9) + while (state < STATE9) { uint32_t currpts; sk.pos = pos_new; @@ -422,7 +422,7 @@ static off_t mpeg_parser_seek_PTS(uint32_t time, unsigned id) pos_new = pos_right; } - state = state2; /* Last scan was early */ + state = STATE2; /* Last scan was early */ sk.dir = SSCAN_REVERSE; DEBUGF(">> tl:%u t:%u ct:%u tr:%u\n pl:%ld pn:%ld pr:%ld\n", @@ -450,7 +450,7 @@ static off_t mpeg_parser_seek_PTS(uint32_t time, unsigned id) pos_new += pos_left - pos_adj; - state = state3; /* Last scan was late */ + state = STATE3; /* Last scan was late */ sk.dir = SSCAN_REVERSE; DEBUGF("<< tl:%u t:%u ct:%u tr:%u\n pl:%ld pn:%ld pr:%ld\n", @@ -465,7 +465,7 @@ static off_t mpeg_parser_seek_PTS(uint32_t time, unsigned id) (unsigned)time_right, pos_left, pos_new, pos_right); pts = currpts; pos = sk.pos; - state = state9; + state = STATE9; } } else @@ -474,17 +474,17 @@ static off_t mpeg_parser_seek_PTS(uint32_t time, unsigned id) switch (state) { - case state1: + case STATE1: /* We already tried the bruteforce scan and failed again - no * more stamps could possibly exist in the interval */ DEBUGF("!! no timestamp 2x\n"); break; - case state0: + case STATE0: /* Hardly likely except at very beginning - just do L->R scan * to find something */ DEBUGF("!! no timestamp on first probe: %ld\n", sk.pos); - case state2: - case state3: + case STATE2: + case STATE3: /* Could just be missing timestamps because the interval is * narrowing down. A large block of data from another stream * may also be in the midst of our chosen points which could @@ -495,7 +495,7 @@ static off_t mpeg_parser_seek_PTS(uint32_t time, unsigned id) DEBUGF("?? tl:%u t:%u ct:%u tr:%u\n pl:%ld pn:%ld pr:%ld\n", (unsigned)time_left, (unsigned)time, (unsigned)currpts, (unsigned)time_right, pos_left, pos_new, pos_right); - state = state1; + state = STATE1; break; default: DEBUGF("?? Invalid state: %d\n", state); @@ -506,7 +506,7 @@ static off_t mpeg_parser_seek_PTS(uint32_t time, unsigned id) if (currpts == prevpts) { DEBUGF("!! currpts == prevpts (stop)\n"); - state = state9; + state = STATE9; } prevpts = currpts; |