summaryrefslogtreecommitdiff
path: root/apps/plugins/mpegplayer/stream_mgr.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2010-12-19 02:11:35 +0000
committerMichael Sevakis <jethead71@rockbox.org>2010-12-19 02:11:35 +0000
commit6b1fcc67c221a021d073394566f4edd58103d661 (patch)
treef76c8e056d4677dd32a59ddf21878e2b56016e59 /apps/plugins/mpegplayer/stream_mgr.c
parentb985b4c54bba1482e9517a0a384766f587d59a47 (diff)
downloadrockbox-6b1fcc67c221a021d073394566f4edd58103d661.tar.gz
rockbox-6b1fcc67c221a021d073394566f4edd58103d661.zip
MPEGPlayer: Fix leakage of file decriptors if file wasn't accepted by playback engine-- code is now getting tested that couldn't be before. Also reset parser in stream init when it doesn't like the file.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28853 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/mpegplayer/stream_mgr.c')
-rw-r--r--apps/plugins/mpegplayer/stream_mgr.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/apps/plugins/mpegplayer/stream_mgr.c b/apps/plugins/mpegplayer/stream_mgr.c
index 2eed3d355d..b88c6d70c7 100644
--- a/apps/plugins/mpegplayer/stream_mgr.c
+++ b/apps/plugins/mpegplayer/stream_mgr.c
@@ -592,7 +592,7 @@ static int stream_on_close(void)
592 592
593 stream_mgr_lock(); 593 stream_mgr_lock();
594 594
595 /* Any open file? */ 595 /* Any open file that was accepted for playback? */
596 if (stream_mgr.filename != NULL) 596 if (stream_mgr.filename != NULL)
597 { 597 {
598 /* Yes - hide video */ 598 /* Yes - hide video */
@@ -602,12 +602,13 @@ static int stream_on_close(void)
602 stream_on_stop(false); 602 stream_on_stop(false);
603 /* Tell parser file is finished */ 603 /* Tell parser file is finished */
604 parser_close_stream(); 604 parser_close_stream();
605 /* Close file */
606 disk_buf_close();
607 /* Reinitialize manager */ 605 /* Reinitialize manager */
608 stream_mgr_init_state(); 606 stream_mgr_init_state();
609 } 607 }
610 608
609 /* Let disk buffer reset itself - file might be open even if no good */
610 disk_buf_close();
611
611 stream_mgr_unlock(); 612 stream_mgr_unlock();
612 613
613 return status; 614 return status;