diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2008-01-27 00:06:36 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2008-01-27 00:06:36 +0000 |
commit | 9ef02a5fec2fe6cfc2765e3cb0b197be09726cd8 (patch) | |
tree | 865700f4688f5ca2f1677310ce8c7c423603b57e /apps/plugins/mpegplayer/mpeg_parser.c | |
parent | ccd8f6cd84ad208d4fbd26b9be2ad5002624de6a (diff) | |
download | rockbox-9ef02a5fec2fe6cfc2765e3cb0b197be09726cd8.tar.gz rockbox-9ef02a5fec2fe6cfc2765e3cb0b197be09726cd8.zip |
mpegplayer: End of data would not be detected correctly if mpeg parser was in a sync state.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16174 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/mpegplayer/mpeg_parser.c')
-rw-r--r-- | apps/plugins/mpegplayer/mpeg_parser.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/apps/plugins/mpegplayer/mpeg_parser.c b/apps/plugins/mpegplayer/mpeg_parser.c index 167f07da5c..345aa73111 100644 --- a/apps/plugins/mpegplayer/mpeg_parser.c +++ b/apps/plugins/mpegplayer/mpeg_parser.c | |||
@@ -679,13 +679,22 @@ static int parse_demux(struct stream *str, enum stream_parse_mode type) | |||
679 | { | 679 | { |
680 | case STREAM_PM_STREAMING: | 680 | case STREAM_PM_STREAMING: |
681 | /* Has the end been reached already? */ | 681 | /* Has the end been reached already? */ |
682 | if (str->state == SSTATE_END) | 682 | switch (str->state) |
683 | { | ||
684 | case SSTATE_PARSE: /* Expected case first if no jumptable */ | ||
685 | /* Are we at the end of file? */ | ||
686 | if (str->hdr.win_left < disk_buf.filesize) | ||
687 | break; | ||
688 | str_end_of_stream(str); | ||
683 | return STREAM_DATA_END; | 689 | return STREAM_DATA_END; |
684 | 690 | ||
685 | /* Are we at the end of file? */ | 691 | case SSTATE_SYNC: |
686 | if (str->hdr.win_left >= disk_buf.filesize) | 692 | /* Is sync at the end of file? */ |
687 | { | 693 | if (str->hdr.win_right < disk_buf.filesize) |
694 | break; | ||
688 | str_end_of_stream(str); | 695 | str_end_of_stream(str); |
696 | /* Fall-through */ | ||
697 | case SSTATE_END: | ||
689 | return STREAM_DATA_END; | 698 | return STREAM_DATA_END; |
690 | } | 699 | } |
691 | 700 | ||