Commit 8b67039c authored by Gildas Bazin's avatar Gildas Bazin

* modules/packetizer/vorbis.c: vorbis data packetizer for the stream output.
* modules/mux/ogg.c: cleanup, bug fixes and vorbis support.
* modules/demux/ogg.c: added vorbis channels info.
* modules/misc/httpd.c: bug fix for stream header generation.
parent 48e78c14
...@@ -1008,12 +1008,7 @@ then ...@@ -1008,12 +1008,7 @@ then
PLUGINS="${PLUGINS} stream_out_dummy stream_out_standard stream_out_es" PLUGINS="${PLUGINS} stream_out_dummy stream_out_standard stream_out_es"
PLUGINS="${PLUGINS} stream_out_duplicate stream_out_display" PLUGINS="${PLUGINS} stream_out_duplicate stream_out_display"
dnl Ogg/ogm dnl Ogg and vorbis are handled in their respective section
AC_CHECK_HEADERS(ogg/ogg.h, [
AC_CHECK_LIB( ogg, ogg_stream_packetin, [
PLUGINS="${PLUGINS} mux_ogg"
LDFLAGS_mux_ogg="${LDFLAGS_mux_ogg} -logg" ])
],[])
fi fi
...@@ -1425,7 +1420,9 @@ then ...@@ -1425,7 +1420,9 @@ then
PLUGINS="${PLUGINS} ogg" PLUGINS="${PLUGINS} ogg"
LDFLAGS_ogg="${LDFLAGS_ogg} -logg" LDFLAGS_ogg="${LDFLAGS_ogg} -logg"
AC_CHECK_LIB( ogg, oggpackB_read, [ AC_CHECK_LIB( ogg, oggpackB_read, [
CPPFLAGS_ogg="${CPPFLAGS_ogg} -DHAVE_OGGPACKB"])]) CPPFLAGS_ogg="${CPPFLAGS_ogg} -DHAVE_OGGPACKB"])
PLUGINS="${PLUGINS} mux_ogg"
LDFLAGS_mux_ogg="${LDFLAGS_mux_ogg} -logg"])
],[]) ],[])
fi fi
...@@ -1889,7 +1886,10 @@ then ...@@ -1889,7 +1886,10 @@ then
AC_CHECK_HEADERS(vorbis/codec.h, [ AC_CHECK_HEADERS(vorbis/codec.h, [
PLUGINS="${PLUGINS} vorbis" PLUGINS="${PLUGINS} vorbis"
LDFLAGS_vorbis="${LDFLAGS_vorbis} -lvorbis -logg" LDFLAGS_vorbis="${LDFLAGS_vorbis} -lvorbis -logg"
],[]) if test "${enable_sout}" != "no"; then
PLUGINS="${PLUGINS} packetizer_vorbis"
LDFLAGS_packetizer_vorbis="${LDFLAGS_packetizer_vorbis} -lvorbis -logg"
fi ],[])
fi fi
dnl dnl
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ogg.c : ogg stream input module for vlc * ogg.c : ogg stream input module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: ogg.c,v 1.26 2003/06/11 15:53:50 gbazin Exp $ * $Id: ogg.c,v 1.27 2003/06/23 23:51:31 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -70,6 +70,7 @@ typedef struct logical_stream_s ...@@ -70,6 +70,7 @@ typedef struct logical_stream_s
/* info from logical streams */ /* info from logical streams */
double f_rate; double f_rate;
int i_bitrate; int i_bitrate;
int i_channels;
int b_reinit; int b_reinit;
/* codec specific stuff */ /* codec specific stuff */
...@@ -543,7 +544,8 @@ static int Ogg_FindLogicalStreams( input_thread_t *p_input, demux_sys_t *p_ogg) ...@@ -543,7 +544,8 @@ static int Ogg_FindLogicalStreams( input_thread_t *p_input, demux_sys_t *p_ogg)
/* Cheat and get additionnal info ;) */ /* Cheat and get additionnal info ;) */
oggpack_readinit( &opb, oggpacket.packet, oggpacket.bytes); oggpack_readinit( &opb, oggpacket.packet, oggpacket.bytes);
oggpack_adv( &opb, 96 ); oggpack_adv( &opb, 88 );
p_stream->i_channels = oggpack_read( &opb, 8 );
p_stream->f_rate = oggpack_read( &opb, 32 ); p_stream->f_rate = oggpack_read( &opb, 32 );
oggpack_adv( &opb, 32 ); oggpack_adv( &opb, 32 );
p_stream->i_bitrate = oggpack_read( &opb, 32 ); p_stream->i_bitrate = oggpack_read( &opb, 32 );
...@@ -556,6 +558,8 @@ static int Ogg_FindLogicalStreams( input_thread_t *p_input, demux_sys_t *p_ogg) ...@@ -556,6 +558,8 @@ static int Ogg_FindLogicalStreams( input_thread_t *p_input, demux_sys_t *p_ogg)
input_AddInfo( p_cat, _("Codec"), _("Vorbis") ); input_AddInfo( p_cat, _("Codec"), _("Vorbis") );
input_AddInfo( p_cat, _("Sample Rate"), "%f", input_AddInfo( p_cat, _("Sample Rate"), "%f",
p_stream->f_rate ); p_stream->f_rate );
input_AddInfo( p_cat, _("Channels"), "%d",
p_stream->i_channels );
input_AddInfo( p_cat, _("Bit Rate"), "%d", input_AddInfo( p_cat, _("Bit Rate"), "%d",
p_stream->i_bitrate ); p_stream->i_bitrate );
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* httpd.c * httpd.c
***************************************************************************** *****************************************************************************
* Copyright (C) 2001-2003 VideoLAN * Copyright (C) 2001-2003 VideoLAN
* $Id: httpd.c,v 1.14 2003/05/09 16:01:17 gbazin Exp $ * $Id: httpd.c,v 1.15 2003/06/23 23:51:31 gbazin Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
...@@ -1612,14 +1612,15 @@ search_file: ...@@ -1612,14 +1612,15 @@ search_file:
p_con->i_state = HTTPD_CONNECTION_SENDING_HEADER; p_con->i_state = HTTPD_CONNECTION_SENDING_HEADER;
p_con->i_buffer_size = 4096;
p_con->i_buffer = 0;
/* we send stream header with this one */ /* we send stream header with this one */
if( p_con->i_http_error == 200 && p_con->p_file->b_stream ) if( p_con->i_http_error == 200 && p_con->p_file->b_stream )
{ {
p_con->i_buffer_size = 4096 + p_con->p_file->i_header_size; p_con->i_buffer_size += p_con->p_file->i_header_size;
} }
p_con->i_buffer_size = 4096;
p_con->i_buffer = 0;
p = p_con->p_buffer = malloc( p_con->i_buffer_size ); p = p_con->p_buffer = malloc( p_con->i_buffer_size );
p += sprintf( p, "HTTP/1.0 %d %s\r\n", p_con->i_http_error, psz_status ); p += sprintf( p, "HTTP/1.0 %d %s\r\n", p_con->i_http_error, psz_status );
...@@ -1633,7 +1634,8 @@ search_file: ...@@ -1633,7 +1634,8 @@ search_file:
p_con->i_buffer_size = strlen( p_con->p_buffer );// + 1; p_con->i_buffer_size = strlen( p_con->p_buffer );// + 1;
if( p_con->i_http_error == 200 && p_con->p_file->b_stream && p_con->p_file->i_header_size > 0 ) if( p_con->i_http_error == 200 && p_con->p_file->b_stream &&
p_con->p_file->i_header_size > 0 )
{ {
/* add stream header */ /* add stream header */
memcpy( &p_con->p_buffer[p_con->i_buffer_size], memcpy( &p_con->p_buffer[p_con->i_buffer_size],
......
This diff is collapsed.
...@@ -4,3 +4,4 @@ SOURCES_packetizer_mpegaudio = modules/packetizer/mpegaudio.c ...@@ -4,3 +4,4 @@ SOURCES_packetizer_mpegaudio = modules/packetizer/mpegaudio.c
SOURCES_packetizer_mpegvideo = modules/packetizer/mpegvideo.c SOURCES_packetizer_mpegvideo = modules/packetizer/mpegvideo.c
SOURCES_packetizer_mpeg4video = modules/packetizer/mpeg4video.c SOURCES_packetizer_mpeg4video = modules/packetizer/mpeg4video.c
SOURCES_packetizer_mpeg4audio = modules/packetizer/mpeg4audio.c SOURCES_packetizer_mpeg4audio = modules/packetizer/mpeg4audio.c
SOURCES_packetizer_vorbis = modules/packetizer/vorbis.c
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment