diff options
author | Teruaki Kawashima <teru@rockbox.org> | 2010-10-23 12:40:07 +0000 |
---|---|---|
committer | Teruaki Kawashima <teru@rockbox.org> | 2010-10-23 12:40:07 +0000 |
commit | d46d24332f3a16fa736def96a717e1648441161a (patch) | |
tree | afc9e1e6958d32651bfcac79ceefefc689d3afb8 /apps/plugins/mp3_encoder.c | |
parent | 368e89e3bc88446c8fac3d5cfca266061f4e77fb (diff) | |
download | rockbox-d46d24332f3a16fa736def96a717e1648441161a.tar.gz rockbox-d46d24332f3a16fa736def96a717e1648441161a.zip |
fix leak-file-handles.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28330 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/mp3_encoder.c')
-rw-r--r-- | apps/plugins/mp3_encoder.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/plugins/mp3_encoder.c b/apps/plugins/mp3_encoder.c index 392fc36d31..5088187b76 100644 --- a/apps/plugins/mp3_encoder.c +++ b/apps/plugins/mp3_encoder.c | |||
@@ -2491,6 +2491,7 @@ enum plugin_status plugin_start(const void* parameter) | |||
2491 | { | 2491 | { |
2492 | int rat, srat, nrat; /* for rate selection */ | 2492 | int rat, srat, nrat; /* for rate selection */ |
2493 | int cont = 1, butt; | 2493 | int cont = 1, butt; |
2494 | int ret; | ||
2494 | long tim = 0; | 2495 | long tim = 0; |
2495 | static const char* bstrg[] = { | 2496 | static const char* bstrg[] = { |
2496 | "64", "80", "96", "112", "128", "160", "192", "224", "256", "320" | 2497 | "64", "80", "96", "112", "128", "160", "192", "224", "256", "320" |
@@ -2544,7 +2545,8 @@ enum plugin_status plugin_start(const void* parameter) | |||
2544 | 2545 | ||
2545 | if(cont) | 2546 | if(cont) |
2546 | { | 2547 | { |
2547 | if(wave_open() == 0) | 2548 | ret = wave_open(); |
2549 | if(ret == 0) | ||
2548 | { | 2550 | { |
2549 | init_mp3_encoder_engine(true, brate[srat], cfg.samplerate); | 2551 | init_mp3_encoder_engine(true, brate[srat], cfg.samplerate); |
2550 | get_mp3_filename(wav_filename); | 2552 | get_mp3_filename(wav_filename); |
@@ -2557,11 +2559,12 @@ enum plugin_status plugin_start(const void* parameter) | |||
2557 | 2559 | ||
2558 | rb->close(wavfile); | 2560 | rb->close(wavfile); |
2559 | rb->close(mp3file); | 2561 | rb->close(mp3file); |
2562 | rb->reload_directory(); | ||
2560 | } | 2563 | } |
2561 | else | 2564 | else |
2562 | { | 2565 | { |
2563 | rb->close(wavfile); | 2566 | rb->close(wavfile); |
2564 | rb->lcd_putsxyf(0, 20, "WaveOpen failed %d", wave_open()); | 2567 | rb->lcd_putsxyf(0, 20, "WaveOpen failed %d", ret); |
2565 | rb->lcd_update(); | 2568 | rb->lcd_update(); |
2566 | rb->sleep(5*HZ); | 2569 | rb->sleep(5*HZ); |
2567 | } | 2570 | } |