mirror of
https://code.videolan.org/videolan/vlc
synced 2024-08-27 04:21:53 +02:00
libvlc: Use a union for libvlc_media_track_info_t.
This commit is contained in:
parent
a3670b8f94
commit
7b5b08e3c7
@ -154,13 +154,18 @@ typedef struct libvlc_media_track_info_t
|
||||
int i_profile;
|
||||
int i_level;
|
||||
|
||||
/* Audio specific */
|
||||
unsigned i_channels;
|
||||
unsigned i_rate;
|
||||
|
||||
/* Video specific */
|
||||
unsigned i_height;
|
||||
unsigned i_width;
|
||||
union {
|
||||
struct {
|
||||
/* Audio specific */
|
||||
unsigned i_channels;
|
||||
unsigned i_rate;
|
||||
} audio;
|
||||
struct {
|
||||
/* Video specific */
|
||||
unsigned i_height;
|
||||
unsigned i_width;
|
||||
} video;
|
||||
} u;
|
||||
|
||||
} libvlc_media_track_info_t;
|
||||
|
||||
|
@ -703,10 +703,6 @@ libvlc_media_get_tracks_info( libvlc_media_t *p_md, libvlc_media_track_info_t **
|
||||
libvlc_media_track_info_t *p_mes = *pp_es+i;
|
||||
const es_format_t *p_es = p_input_item->es[i];
|
||||
|
||||
p_mes->i_channels = p_mes->i_rate = 0;
|
||||
p_mes->i_width = p_mes->i_height = 0;
|
||||
|
||||
|
||||
p_mes->i_codec = p_es->i_codec;
|
||||
p_mes->i_id = p_es->i_id;
|
||||
|
||||
@ -721,13 +717,13 @@ libvlc_media_get_tracks_info( libvlc_media_t *p_md, libvlc_media_track_info_t **
|
||||
break;
|
||||
case VIDEO_ES:
|
||||
p_mes->i_type = libvlc_track_video;
|
||||
p_mes->i_height = p_es->video.i_height;
|
||||
p_mes->i_width = p_es->video.i_width;
|
||||
p_mes->u.video.i_height = p_es->video.i_height;
|
||||
p_mes->u.video.i_width = p_es->video.i_width;
|
||||
break;
|
||||
case AUDIO_ES:
|
||||
p_mes->i_type = libvlc_track_audio;
|
||||
p_mes->i_channels = p_es->audio.i_channels;
|
||||
p_mes->i_rate = p_es->audio.i_rate;
|
||||
p_mes->u.audio.i_channels = p_es->audio.i_channels;
|
||||
p_mes->u.audio.i_rate = p_es->audio.i_rate;
|
||||
break;
|
||||
case SPU_ES:
|
||||
p_mes->i_type = libvlc_track_text;
|
||||
|
Loading…
Reference in New Issue
Block a user