Commit e38b9b06 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

MMS: coherence with asf demuxer

parent e7e469f4
......@@ -52,7 +52,7 @@ void asf_HeaderParse ( asf_header_t *hdr,
hdr->i_min_data_packet_size = 0;
for( unsigned i = 0; i < 128; i++ )
{
hdr->stream[i].i_cat = ASF_STREAM_UNKNOWN;
hdr->stream[i].i_cat = ASF_CODEC_TYPE_UNKNOWN;
hdr->stream[i].i_selected = 0;
hdr->stream[i].i_bitrate = -1;
}
......@@ -140,15 +140,15 @@ void asf_HeaderParse ( asf_header_t *hdr,
if( guidcmp( &stream_type, &asf_object_stream_type_video ) )
{
hdr->stream[i_stream_id].i_cat = ASF_STREAM_VIDEO;
hdr->stream[i_stream_id].i_cat = ASF_CODEC_TYPE_VIDEO;
}
else if( guidcmp( &stream_type, &asf_object_stream_type_audio ) )
{
hdr->stream[i_stream_id].i_cat = ASF_STREAM_AUDIO;
hdr->stream[i_stream_id].i_cat = ASF_CODEC_TYPE_AUDIO;
}
else
{
hdr->stream[i_stream_id].i_cat = ASF_STREAM_UNKNOWN;
hdr->stream[i_stream_id].i_cat = ASF_CODEC_TYPE_UNKNOWN;
}
}
else if ( guidcmp( &guid, &asf_object_stream_bitrate_properties ) )
......@@ -198,7 +198,7 @@ void asf_StreamSelect ( asf_header_t *hdr,
/* select all valid stream */
for( i = 1; i < 128; i++ )
{
if( hdr->stream[i].i_cat != ASF_STREAM_UNKNOWN )
if( hdr->stream[i].i_cat != ASF_CODEC_TYPE_UNKNOWN )
{
hdr->stream[i].i_selected = 1;
}
......@@ -229,11 +229,11 @@ void asf_StreamSelect ( asf_header_t *hdr,
*/
for( i = 1; i < 128; i++ )
{
if( hdr->stream[i].i_cat == ASF_STREAM_UNKNOWN )
if( hdr->stream[i].i_cat == ASF_CODEC_TYPE_UNKNOWN )
{
continue;
}
else if( hdr->stream[i].i_cat == ASF_STREAM_AUDIO && b_audio &&
else if( hdr->stream[i].i_cat == ASF_CODEC_TYPE_AUDIO && b_audio &&
( i_audio <= 0 ||
( ( ( hdr->stream[i].i_bitrate > hdr->stream[i_audio].i_bitrate &&
( i_bitrate_total + hdr->stream[i].i_bitrate - hdr->stream[i_audio].i_bitrate
......@@ -259,7 +259,7 @@ void asf_StreamSelect ( asf_header_t *hdr,
}
i_audio = i;
}
else if( hdr->stream[i].i_cat == ASF_STREAM_VIDEO && b_video &&
else if( hdr->stream[i].i_cat == ASF_CODEC_TYPE_VIDEO && b_video &&
( i_video <= 0 ||
(
( ( hdr->stream[i].i_bitrate > hdr->stream[i_video].i_bitrate &&
......
......@@ -33,13 +33,13 @@
#include "../../demux/asf/libasf_guid.h"
#define ASF_STREAM_VIDEO 0x0001
#define ASF_STREAM_AUDIO 0x0002
#define ASF_STREAM_UNKNOWN 0xffff
#define ASF_CODEC_TYPE_VIDEO 0x0001
#define ASF_CODEC_TYPE_AUDIO 0x0002
#define ASF_CODEC_TYPE_UNKNOWN 0xffff
typedef struct
{
int i_cat; /* ASF_STREAM_VIDEO, ASF_STREAM_AUDIO */
int i_cat; /* ASF_CODEC_TYPE_VIDEO, ASF_CODEC_TYPE_AUDIO, */
int i_bitrate; /* -1 if unknown */
int i_selected;
} asf_stream_t;
......
......@@ -774,7 +774,7 @@ static int Start( access_t *p_access, uint64_t i_pos )
for( i = 1; i < 128; i++ )
{
if( p_sys->asfh.stream[i].i_cat == ASF_STREAM_UNKNOWN )
if( p_sys->asfh.stream[i].i_cat == ASF_CODEC_TYPE_UNKNOWN )
continue;
i_streams++;
if( p_sys->asfh.stream[i].i_selected )
......@@ -816,7 +816,7 @@ static int Start( access_t *p_access, uint64_t i_pos )
for( i = 1; i < 128; i++ )
{
if( p_sys->asfh.stream[i].i_cat != ASF_STREAM_UNKNOWN )
if( p_sys->asfh.stream[i].i_cat != ASF_CODEC_TYPE_UNKNOWN )
{
int i_select = 2;
if( p_sys->asfh.stream[i].i_selected )
......
......@@ -803,7 +803,7 @@ static int MMSOpen( access_t *p_access, vlc_url_t *p_url, int i_proto )
for( i = 1; i < 128; i++ )
{
if( p_sys->asfh.stream[i].i_cat != ASF_STREAM_UNKNOWN )
if( p_sys->asfh.stream[i].i_cat != ASF_CODEC_TYPE_UNKNOWN )
{
i_streams++;
if( i_first != -1 )
......@@ -821,7 +821,7 @@ static int MMSOpen( access_t *p_access, vlc_url_t *p_url, int i_proto )
msg_Info( p_access,
"selecting stream[0x%x] %s (%d Kib/s)",
i,
( p_sys->asfh.stream[i].i_cat == ASF_STREAM_AUDIO ) ?
( p_sys->asfh.stream[i].i_cat == ASF_CODEC_TYPE_AUDIO ) ?
"audio" : "video" ,
p_sys->asfh.stream[i].i_bitrate / 1024);
}
......@@ -831,7 +831,7 @@ static int MMSOpen( access_t *p_access, vlc_url_t *p_url, int i_proto )
msg_Info( p_access,
"ignoring stream[0x%x] %s (%d Kib/s)",
i,
( p_sys->asfh.stream[i].i_cat == ASF_STREAM_AUDIO ) ?
( p_sys->asfh.stream[i].i_cat == ASF_CODEC_TYPE_AUDIO ) ?
"audio" : "video" ,
p_sys->asfh.stream[i].i_bitrate / 1024);
......
......@@ -190,7 +190,7 @@ typedef struct
#define ASF_CODEC_TYPE_VIDEO 0x0001
#define ASF_CODEC_TYPE_AUDIO 0x0002
#define ASF_CODEC_TYPE_UNKNOW 0xffff
#define ASF_CODEC_TYPE_UNKNOWN 0xffff
typedef struct
{
......
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