forked from len0rd/rockbox
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
This commit is contained in:
parent
ccd8f6cd84
commit
9ef02a5fec
1 changed files with 13 additions and 4 deletions
|
@ -679,13 +679,22 @@ static int parse_demux(struct stream *str, enum stream_parse_mode type)
|
||||||
{
|
{
|
||||||
case STREAM_PM_STREAMING:
|
case STREAM_PM_STREAMING:
|
||||||
/* Has the end been reached already? */
|
/* Has the end been reached already? */
|
||||||
if (str->state == SSTATE_END)
|
switch (str->state)
|
||||||
|
{
|
||||||
|
case SSTATE_PARSE: /* Expected case first if no jumptable */
|
||||||
|
/* Are we at the end of file? */
|
||||||
|
if (str->hdr.win_left < disk_buf.filesize)
|
||||||
|
break;
|
||||||
|
str_end_of_stream(str);
|
||||||
return STREAM_DATA_END;
|
return STREAM_DATA_END;
|
||||||
|
|
||||||
/* Are we at the end of file? */
|
case SSTATE_SYNC:
|
||||||
if (str->hdr.win_left >= disk_buf.filesize)
|
/* Is sync at the end of file? */
|
||||||
{
|
if (str->hdr.win_right < disk_buf.filesize)
|
||||||
|
break;
|
||||||
str_end_of_stream(str);
|
str_end_of_stream(str);
|
||||||
|
/* Fall-through */
|
||||||
|
case SSTATE_END:
|
||||||
return STREAM_DATA_END;
|
return STREAM_DATA_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue