Commit 7b5b08e3 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

libvlc: Use a union for libvlc_media_track_info_t.

parent a3670b8f
...@@ -154,13 +154,18 @@ typedef struct libvlc_media_track_info_t ...@@ -154,13 +154,18 @@ typedef struct libvlc_media_track_info_t
int i_profile; int i_profile;
int i_level; int i_level;
union {
struct {
/* Audio specific */ /* Audio specific */
unsigned i_channels; unsigned i_channels;
unsigned i_rate; unsigned i_rate;
} audio;
struct {
/* Video specific */ /* Video specific */
unsigned i_height; unsigned i_height;
unsigned i_width; unsigned i_width;
} video;
} u;
} libvlc_media_track_info_t; } libvlc_media_track_info_t;
......
...@@ -703,10 +703,6 @@ libvlc_media_get_tracks_info( libvlc_media_t *p_md, 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; libvlc_media_track_info_t *p_mes = *pp_es+i;
const es_format_t *p_es = p_input_item->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_codec = p_es->i_codec;
p_mes->i_id = p_es->i_id; 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 ** ...@@ -721,13 +717,13 @@ libvlc_media_get_tracks_info( libvlc_media_t *p_md, libvlc_media_track_info_t **
break; break;
case VIDEO_ES: case VIDEO_ES:
p_mes->i_type = libvlc_track_video; p_mes->i_type = libvlc_track_video;
p_mes->i_height = p_es->video.i_height; p_mes->u.video.i_height = p_es->video.i_height;
p_mes->i_width = p_es->video.i_width; p_mes->u.video.i_width = p_es->video.i_width;
break; break;
case AUDIO_ES: case AUDIO_ES:
p_mes->i_type = libvlc_track_audio; p_mes->i_type = libvlc_track_audio;
p_mes->i_channels = p_es->audio.i_channels; p_mes->u.audio.i_channels = p_es->audio.i_channels;
p_mes->i_rate = p_es->audio.i_rate; p_mes->u.audio.i_rate = p_es->audio.i_rate;
break; break;
case SPU_ES: case SPU_ES:
p_mes->i_type = libvlc_track_text; p_mes->i_type = libvlc_track_text;
......
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