diff options
Diffstat (limited to 'apps/plugins/mpegplayer/mpegplayer.c')
-rw-r--r-- | apps/plugins/mpegplayer/mpegplayer.c | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/apps/plugins/mpegplayer/mpegplayer.c b/apps/plugins/mpegplayer/mpegplayer.c index 8b6d1e20bd..37ac1fa78c 100644 --- a/apps/plugins/mpegplayer/mpegplayer.c +++ b/apps/plugins/mpegplayer/mpegplayer.c | |||
@@ -1170,7 +1170,7 @@ static int button_loop(void) | |||
1170 | str_send_msg(&video_str, STREAM_QUIT, 0); | 1170 | str_send_msg(&video_str, STREAM_QUIT, 0); |
1171 | audio_str.status = STREAM_STOPPED; | 1171 | audio_str.status = STREAM_STOPPED; |
1172 | } | 1172 | } |
1173 | } | 1173 | } |
1174 | } | 1174 | } |
1175 | quit: | 1175 | quit: |
1176 | return audio_str.status; | 1176 | return audio_str.status; |
@@ -2227,6 +2227,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
2227 | api->splash(HZ*2, "No File"); | 2227 | api->splash(HZ*2, "No File"); |
2228 | return PLUGIN_ERROR; | 2228 | return PLUGIN_ERROR; |
2229 | } | 2229 | } |
2230 | api->talk_disable(true); | ||
2230 | 2231 | ||
2231 | /* Initialize IRAM - stops audio and voice as well */ | 2232 | /* Initialize IRAM - stops audio and voice as well */ |
2232 | PLUGIN_IRAM_INIT(api) | 2233 | PLUGIN_IRAM_INIT(api) |
@@ -2253,6 +2254,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
2253 | audiosize -= graysize; | 2254 | audiosize -= graysize; |
2254 | if (grayscales < 33 || audiosize <= 0) | 2255 | if (grayscales < 33 || audiosize <= 0) |
2255 | { | 2256 | { |
2257 | rb->talk_disable(false); | ||
2256 | rb->splash(HZ, "gray buf error"); | 2258 | rb->splash(HZ, "gray buf error"); |
2257 | return PLUGIN_ERROR; | 2259 | return PLUGIN_ERROR; |
2258 | } | 2260 | } |
@@ -2261,7 +2263,10 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
2261 | /* Initialise our malloc buffer */ | 2263 | /* Initialise our malloc buffer */ |
2262 | audiosize = mpeg_alloc_init(audiobuf,audiosize, LIBMPEG2BUFFER_SIZE); | 2264 | audiosize = mpeg_alloc_init(audiobuf,audiosize, LIBMPEG2BUFFER_SIZE); |
2263 | if (audiosize == 0) | 2265 | if (audiosize == 0) |
2266 | { | ||
2267 | rb->talk_disable(false); | ||
2264 | return PLUGIN_ERROR; | 2268 | return PLUGIN_ERROR; |
2269 | } | ||
2265 | 2270 | ||
2266 | /* Set disk pointers to NULL */ | 2271 | /* Set disk pointers to NULL */ |
2267 | disk_buf_end = disk_buf_start = NULL; | 2272 | disk_buf_end = disk_buf_start = NULL; |
@@ -2275,13 +2280,21 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
2275 | disk_buf_start = mpeg_malloc(disk_buf_size,-1); | 2280 | disk_buf_start = mpeg_malloc(disk_buf_size,-1); |
2276 | 2281 | ||
2277 | if (disk_buf_start == NULL) | 2282 | if (disk_buf_start == NULL) |
2283 | { | ||
2284 | rb->talk_disable(false); | ||
2278 | return PLUGIN_ERROR; | 2285 | return PLUGIN_ERROR; |
2286 | } | ||
2279 | 2287 | ||
2280 | if (!init_mpabuf()) | 2288 | if (!init_mpabuf()) |
2289 | { | ||
2290 | rb->talk_disable(false); | ||
2281 | return PLUGIN_ERROR; | 2291 | return PLUGIN_ERROR; |
2282 | 2292 | } | |
2283 | if (!init_pcmbuf()) | 2293 | if (!init_pcmbuf()) |
2294 | { | ||
2295 | rb->talk_disable(false); | ||
2284 | return PLUGIN_ERROR; | 2296 | return PLUGIN_ERROR; |
2297 | } | ||
2285 | 2298 | ||
2286 | /* The remaining buffer is for use by libmpeg2 */ | 2299 | /* The remaining buffer is for use by libmpeg2 */ |
2287 | 2300 | ||
@@ -2290,6 +2303,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
2290 | 2303 | ||
2291 | if (in_file < 0){ | 2304 | if (in_file < 0){ |
2292 | DEBUGF("Could not open %s\n",(char*)parameter); | 2305 | DEBUGF("Could not open %s\n",(char*)parameter); |
2306 | rb->talk_disable(false); | ||
2293 | return PLUGIN_ERROR; | 2307 | return PLUGIN_ERROR; |
2294 | } | 2308 | } |
2295 | filename = (char*)parameter; | 2309 | filename = (char*)parameter; |
@@ -2322,6 +2336,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
2322 | switch (result) | 2336 | switch (result) |
2323 | { | 2337 | { |
2324 | case MPEG_START_QUIT: | 2338 | case MPEG_START_QUIT: |
2339 | rb->talk_disable(false); | ||
2325 | return 0; | 2340 | return 0; |
2326 | default: | 2341 | default: |
2327 | start_time = settings.resume_time; | 2342 | start_time = settings.resume_time; |
@@ -2336,7 +2351,6 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
2336 | 2351 | ||
2337 | /* Turn off backlight timeout */ | 2352 | /* Turn off backlight timeout */ |
2338 | backlight_force_on(rb); /* backlight control in lib/helper.c */ | 2353 | backlight_force_on(rb); /* backlight control in lib/helper.c */ |
2339 | rb->talk_disable_menus(); | ||
2340 | 2354 | ||
2341 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ | 2355 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ |
2342 | rb->cpu_boost(true); | 2356 | rb->cpu_boost(true); |
@@ -2463,8 +2477,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
2463 | n = rb->read(in_file, disk_buf_tail,bytes_to_read); | 2477 | n = rb->read(in_file, disk_buf_tail,bytes_to_read); |
2464 | if (n==0) | 2478 | if (n==0) |
2465 | rb->splash(30,"buffer fill error"); | 2479 | rb->splash(30,"buffer fill error"); |
2466 | } | 2480 | } |
2467 | |||
2468 | 2481 | ||
2469 | bytes_to_read -= n; | 2482 | bytes_to_read -= n; |
2470 | file_remaining -= n; | 2483 | file_remaining -= n; |
@@ -2531,7 +2544,6 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
2531 | 2544 | ||
2532 | /* Turn on backlight timeout (revert to settings) */ | 2545 | /* Turn on backlight timeout (revert to settings) */ |
2533 | backlight_use_settings(rb); /* backlight control in lib/helper.c */ | 2546 | backlight_use_settings(rb); /* backlight control in lib/helper.c */ |
2534 | rb->talk_enable_menus(); | 2547 | rb->talk_disable(false); |
2535 | |||
2536 | return status; | 2548 | return status; |
2537 | } | 2549 | } |