Commit b99b1271 authored by Laurent Aimar's avatar Laurent Aimar

* es_out: reorder meta infos.

parent 3104e5dc
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* es_out.c: Es Out handler for input. * es_out.c: Es Out handler for input.
***************************************************************************** *****************************************************************************
* Copyright (C) 2003-2004 VideoLAN * Copyright (C) 2003-2004 VideoLAN
* $Id: es_out.c,v 1.24 2004/01/31 20:02:26 fenrir Exp $ * $Id: es_out.c,v 1.25 2004/01/31 20:21:47 fenrir Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
...@@ -407,78 +407,78 @@ static es_out_id_t *EsOutAdd( es_out_t *out, es_format_t *fmt ) ...@@ -407,78 +407,78 @@ static es_out_id_t *EsOutAdd( es_out_t *out, es_format_t *fmt )
( p_playlist = (playlist_t *)vlc_object_find( p_input, ( p_playlist = (playlist_t *)vlc_object_find( p_input,
VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ) ) ) VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ) ) )
{ {
/* Add information */ char *psz_type;
switch( fmt->i_cat ) switch( fmt->i_cat )
{ {
case AUDIO_ES: case AUDIO_ES:
if( fmt->psz_description ) psz_type = _("Audio");
break;
case VIDEO_ES:
psz_type = _("Video");
break;
case SPU_ES:
psz_type = _("Subtitle");
break;
default:
psz_type = NULL;
break;
}
if( psz_type )
{ {
input_AddInfo( p_cat, _("Description"), "%s", input_AddInfo( p_cat, _("Type"), psz_type );
fmt->psz_description ); playlist_AddInfo( p_playlist, -1, psz_cat, _("Type"), psz_type );
playlist_AddInfo( p_playlist, -1, psz_cat, }
_("Description"), "%s", input_AddInfo( p_cat, _("Codec"), "%.4s", (char*)&fmt->i_codec );
fmt->psz_description ); playlist_AddInfo( p_playlist, -1, psz_cat, _("Codec"),
"%.4s",(char*)&fmt->i_codec );
if( *psz_description )
{
input_AddInfo( p_cat, _("Language"), psz_description );
playlist_AddInfo( p_playlist, -1, psz_cat, _("Language"),
"%s", psz_description );
}
if( fmt->psz_description && *fmt->psz_description )
{
input_AddInfo( p_cat, _("Description"), "%s", fmt->psz_description );
playlist_AddInfo( p_playlist, -1, psz_cat, _("Description"),
"%s", fmt->psz_description );
} }
input_AddInfo( p_cat, _("Codec"), "%.4s",
(char*)&fmt->i_codec );
playlist_AddInfo( p_playlist, -1, psz_cat,
_("Codec"),"%.4s",(char*)&fmt->i_codec );
input_AddInfo( p_cat, _("Type"), _("Audio") );
playlist_AddInfo( p_playlist, -1, psz_cat,
_("Type"), _("Audio") );
/* Add information */
switch( fmt->i_cat )
{
case AUDIO_ES:
if( fmt->audio.i_channels > 0 ) if( fmt->audio.i_channels > 0 )
{ {
input_AddInfo( p_cat, _("Channels"), "%d", input_AddInfo( p_cat, _("Channels"),
fmt->audio.i_channels ); "%d", fmt->audio.i_channels );
playlist_AddInfo( p_playlist, -1, psz_cat, playlist_AddInfo( p_playlist, -1, psz_cat, _("Channels"),
_("Channels"), "%d", fmt->audio.i_channels ); "%d", fmt->audio.i_channels );
} }
if( fmt->audio.i_rate > 0 ) if( fmt->audio.i_rate > 0 )
{ {
input_AddInfo( p_cat, _("Sample rate"), _("%d Hz"), input_AddInfo( p_cat, _("Sample rate"),
fmt->audio.i_rate ); _("%d Hz"), fmt->audio.i_rate );
playlist_AddInfo( p_playlist, -1, psz_cat, playlist_AddInfo( p_playlist, -1, psz_cat, _("Sample rate"),
_("Sample rate"), _("%d Hz"), _("%d Hz"), fmt->audio.i_rate );
fmt->audio.i_rate );
} }
if( fmt->i_bitrate > 0 ) if( fmt->audio.i_bitspersample > 0 )
{ {
input_AddInfo( p_cat, _("Bitrate"), _("%d bps"), input_AddInfo( p_cat, _("Bits per sample"),
fmt->i_bitrate ); "%d", fmt->audio.i_bitspersample );
playlist_AddInfo( p_playlist, -1, psz_cat, playlist_AddInfo( p_playlist, -1, psz_cat, _("Bits per sample"),
_("Bitrate"), _("%d bps"), "%d", fmt->audio.i_bitspersample );
fmt->i_bitrate );
} }
if( fmt->audio.i_bitspersample ) if( fmt->i_bitrate > 0 )
{ {
input_AddInfo( p_cat, _("Bits per sample"), "%d", input_AddInfo( p_cat, _("Bitrate"),
fmt->audio.i_bitspersample ); _("%d bps"), fmt->i_bitrate );
playlist_AddInfo( p_playlist, -1, psz_cat, playlist_AddInfo( p_playlist, -1, psz_cat, _("Bitrate"),
_("Bits per sample"), "%d", _("%d bps"), fmt->i_bitrate );
fmt->audio.i_bitspersample );
} }
break; break;
case VIDEO_ES:
if( fmt->psz_description )
{
input_AddInfo( p_cat, _("Description"), "%s",
fmt->psz_description );
playlist_AddInfo( p_playlist, -1, psz_cat,
_("Description"), "%s",
fmt->psz_description );
}
input_AddInfo( p_cat, _("Type"), _("Video") );
playlist_AddInfo( p_playlist, -1, psz_cat,
_("Type"), _("Video") );
input_AddInfo( p_cat, _("Codec"), "%.4s",
(char*)&fmt->i_codec );
playlist_AddInfo( p_playlist, -1, psz_cat,
_("Codec"), "%.4s",
(char*)&fmt->i_codec );
case VIDEO_ES:
if( fmt->video.i_width > 0 && fmt->video.i_height > 0 ) if( fmt->video.i_width > 0 && fmt->video.i_height > 0 )
{ {
input_AddInfo( p_cat, _("Resolution"), "%dx%d", input_AddInfo( p_cat, _("Resolution"), "%dx%d",
...@@ -499,27 +499,13 @@ static es_out_id_t *EsOutAdd( es_out_t *out, es_format_t *fmt ) ...@@ -499,27 +499,13 @@ static es_out_id_t *EsOutAdd( es_out_t *out, es_format_t *fmt )
fmt->video.i_visible_height); fmt->video.i_visible_height);
} }
break; break;
case SPU_ES: case SPU_ES:
input_AddInfo( p_cat, _("Type"), _("Subtitle") );
playlist_AddInfo( p_playlist, -1, psz_cat,
_("Type"), _("Subtitle") );
input_AddInfo( p_cat, _("Codec"), "%.4s",
(char*)&fmt->i_codec );
playlist_AddInfo( p_playlist, -1, psz_cat,
_("Codec"), "%.4s",
(char*)&fmt->i_codec );
break;
default: default:
break; break;
} }
if( p_playlist ) vlc_object_release( p_playlist ); if( p_playlist ) vlc_object_release( p_playlist );
} }
if( *psz_description )
{
input_AddInfo( p_cat, _("Language"), psz_description );
playlist_AddInfo( p_playlist, -1, psz_cat, _("Language"), "%s", psz_description );
}
free( psz_description ); free( psz_description );
es_format_Copy( &es->p_es->fmt, fmt ); es_format_Copy( &es->p_es->fmt, fmt );
......
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