View | Details | Raw Unified | Return to bug 61668
Collapse All | Expand All

(-)a/src/mod/formats/mod_vlc/mod_vlc.c (-7 / +6 lines)
Lines 590-596 static switch_status_t av_init_handle(switch_file_handle_t *handle, switch_image Link Here
590
	const char *tmp;
590
	const char *tmp;
591
    vlc_file_context_t *acontext = handle->private_info;
591
    vlc_file_context_t *acontext = handle->private_info;
592
	const char * opts[25] = {0};
592
	const char * opts[25] = {0};
593
	int argc = 2;
593
	int argc = 1;
594
	vlc_video_context_t *vcontext;
594
	vlc_video_context_t *vcontext;
595
595
596
	if (!acontext) {
596
	if (!acontext) {
Lines 598-604 static switch_status_t av_init_handle(switch_file_handle_t *handle, switch_image Link Here
598
	}
598
	}
599
599
600
	opts[0] = *vlc_args;
600
	opts[0] = *vlc_args;
601
	opts[1] = switch_core_sprintf(acontext->pool, "--sout=%s", acontext->path);
602
601
603
	pool = acontext->pool;
602
	pool = acontext->pool;
604
603
Lines 665-678 static switch_status_t av_init_handle(switch_file_handle_t *handle, switch_image Link Here
665
											 vcontext->samplerate, vcontext->channels);
664
											 vcontext->samplerate, vcontext->channels);
666
665
667
	vcontext->m = libvlc_media_new_location(acontext->vlc_handle, imem_main);
666
	vcontext->m = libvlc_media_new_location(acontext->vlc_handle, imem_main);
668
669
	libvlc_media_add_option_flag( vcontext->m, imem_slave, libvlc_media_option_trusted );
670
671
	if (vcontext->m == NULL) {
667
	if (vcontext->m == NULL) {
672
		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "VLC error opening %s for writing\n", acontext->path);
668
		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "VLC error opening %s for writing\n", acontext->path);
673
		return SWITCH_STATUS_FALSE;
669
		return SWITCH_STATUS_FALSE;
674
	}
670
	}
675
671
672
	/* Attach the recording output to the input, not the VLC instance. */
673
	libvlc_media_add_option_flag(vcontext->m, switch_core_sprintf(pool, ":sout=%s", acontext->path), libvlc_media_option_trusted);
674
	libvlc_media_add_option_flag(vcontext->m, imem_slave, libvlc_media_option_trusted);
675
676
	vcontext->mp = libvlc_media_player_new_from_media(vcontext->m);
676
	vcontext->mp = libvlc_media_player_new_from_media(vcontext->m);
677
677
678
	vcontext->samples = 0;
678
	vcontext->samples = 0;
Lines 780-786 static switch_status_t vlc_file_open(switch_file_handle_t *handle, const char *p Link Here
780
	if (switch_test_flag(handle, SWITCH_FILE_FLAG_VIDEO) && switch_test_flag(handle, SWITCH_FILE_FLAG_WRITE)) {
780
	if (switch_test_flag(handle, SWITCH_FILE_FLAG_VIDEO) && switch_test_flag(handle, SWITCH_FILE_FLAG_WRITE)) {
781
		if ((ext = strrchr(path, '.')) && !strcasecmp(ext, ".mp4")) {
781
		if ((ext = strrchr(path, '.')) && !strcasecmp(ext, ".mp4")) {
782
			realpath = path;
782
			realpath = path;
783
			path = switch_core_sprintf(context->pool, "#transcode{vcodec=h264,acodec=mpga}:std{access=file,mux=mp4,dst=%s}", path);
783
			path = switch_core_sprintf(context->pool, "#transcode{vcodec=h264,acodec=mp4a}:std{access=file,mux=mp4,dst=%s}", path);
784
		} else if (handle->stream_name && (!strcasecmp(handle->stream_name, "rtmp") || !strcasecmp(handle->stream_name, "youtube"))) {
784
		} else if (handle->stream_name && (!strcasecmp(handle->stream_name, "rtmp") || !strcasecmp(handle->stream_name, "youtube"))) {
785
785
786
			handle->mm.samplerate = 44100;
786
			handle->mm.samplerate = 44100;
787
- 

Return to bug 61668