Example #1
0
File: fb.c Project: gettler/mvpmc
void
fb_thruput(void)
{
	char path[256];

	switch_hw_state(MVPMC_STATE_FILEBROWSER);

	sprintf(path, "%s/%s", cwd, current_hilite);

	if (current)
		free(current);
	current = strdup(path);

	video_functions = &file_functions;

	demux_reset(handle);
	demux_attr_reset(handle);
	video_play(NULL);
}
Example #2
0
int
file_open(void)
{
	seeking = 1;
	audio_selected = 0;
	audio_checks = 0;

	if ( http_playing == HTTP_FILE_CLOSED ) {
		if (video_reopen == 1)
			audio_clear();
		
		close(fd);
		fd = -1;
	}

        if (video_write_thread) {
            pthread_kill(video_write_thread, SIGURG);
        }
        if (audio_write_thread) {
            pthread_kill(audio_write_thread, SIGURG);
        }

	if ( http_playing == HTTP_FILE_CLOSED ) {
		if (gui_state != MVPMC_STATE_EMULATE) {
			fd=open(current, O_RDONLY|O_LARGEFILE);
		} else {
			fd = open("/tmp/FIFO", O_RDONLY);
		}
		if (fd < 0) {
			printf("Open failed errno %d file %s\n",
			       errno, current);
			video_reopen = 0;
			return -1;
		}
		printf("opened %s\n", current);
	} else {
		printf("http opened %s\n", current);
	}

	if (video_reopen == 1) {
		av_set_audio_output(AV_AUDIO_MPEG);
		fd_audio = av_get_audio_fd();

		av_play();

		demux_reset(handle);
		ts_demux_reset(tshandle);
		demux_attr_reset(handle);
		demux_seek(handle);
		vid_event_discontinuity_possible();
		if (gui_state == MVPMC_STATE_EMULATE || http_playing == HTTP_VIDEO_FILE_MPG) {
			video_thumbnail(AV_THUMBNAIL_OFF, 0);
		} else {
			video_thumbnail(AV_THUMBNAIL_EIGTH, 0);
		}
		av_play();
	}

	zoomed = 0;
	display_on = 0;

	seeking = 0;
	jumping = 0;
	audio_type = 0;
	pcm_decoded = 0;
	ac3len = 0;

	video_reopen = 0;

	pthread_cond_broadcast(&video_cond);

	printf("write threads released\n");

	return 0;
}