summaryrefslogtreecommitdiff
path: root/mediainfo
diff options
context:
space:
mode:
authorStefan Sauer <ensonic@users.sf.net>2013-09-06 08:03:51 +0200
committerStefan Sauer <ensonic@users.sf.net>2013-09-15 19:50:33 +0200
commit2309c6d7fb8bb58df602e895259838b1ff65adaf (patch)
tree6e60bb29406a0b11776f66317a5b357feb579b74 /mediainfo
parent03892e1e9f319c3af4c3f309d97c8fc9eccb85f3 (diff)
mi-info: fix tab-index in compact mode
Diffstat (limited to 'mediainfo')
-rw-r--r--mediainfo/src/mi-info.vala37
1 files changed, 28 insertions, 9 deletions
diff --git a/mediainfo/src/mi-info.vala b/mediainfo/src/mi-info.vala
index 2fa7dbb..9cefb1d 100644
--- a/mediainfo/src/mi-info.vala
+++ b/mediainfo/src/mi-info.vala
@@ -363,6 +363,7 @@ public class MediaInfo.Info : Box
// sort streams
ArrayList<string> sids = new ArrayList<string> ();
int six;
+ int page_offset;
if (info == null) {
container_caps.set_text ("");
@@ -397,6 +398,7 @@ public class MediaInfo.Info : Box
debug ("stream[%d:%s]: %s", i, sinfo.get_stream_type_nick(), sinfo.get_caps ().to_string ());
}
*/
+ // get stream info
sinfo = info.get_stream_info ();
if (sinfo != null) {
caps = sinfo.get_caps ();
@@ -409,16 +411,20 @@ public class MediaInfo.Info : Box
while (all_streams.get_n_pages() > 0) {
all_streams.remove_page (-1);
}
- } else {
+ } else {
while (video_streams.get_n_pages() > 0) {
video_streams.remove_page (-1);
}
while (audio_streams.get_n_pages() > 0) {
audio_streams.remove_page (-1);
}
+ while (subtitle_streams.get_n_pages() > 0) {
+ subtitle_streams.remove_page (-1);
+ }
}
-
- // get stream info
+ page_offset = 0;
+
+ // do video streams
nb = compact_mode ? all_streams : video_streams;
l = info.get_video_streams ();
num_video_streams = l.length ();
@@ -545,10 +551,15 @@ public class MediaInfo.Info : Box
// sinfo.get_toc()
six = get_stream_index (sinfo, sids);
- nb.insert_page (table, new Label (@"video $i"), six);
+ nb.insert_page (table, new Label (@"video $i"), page_offset + six);
+ }
+ if (compact_mode) {
+ page_offset += (int)num_video_streams;
+ } else {
+ nb.show_all();
}
- nb.show_all();
+ // do audio streams
nb = compact_mode ? all_streams : audio_streams;
l = info.get_audio_streams ();
num_audio_streams = l.length ();
@@ -647,10 +658,15 @@ public class MediaInfo.Info : Box
}
six = get_stream_index (sinfo, sids);
- nb.insert_page (table, new Label (@"audio $i"), six);
+ nb.insert_page (table, new Label (@"audio $i"), page_offset + six);
}
- nb.show_all();
-
+ if (compact_mode) {
+ page_offset += (int)num_audio_streams;
+ } else {
+ nb.show_all();
+ }
+
+ // do subtitle streams
nb = compact_mode ? all_streams : subtitle_streams;
l = info.get_subtitle_streams ();
num_subtitle_streams = l.length ();
@@ -708,7 +724,10 @@ public class MediaInfo.Info : Box
}
six = get_stream_index (sinfo, sids);
- nb.insert_page (table, new Label (@"subtitle $i"), six);
+ nb.insert_page (table, new Label (@"subtitle $i"), page_offset + six);
+ }
+ if (compact_mode) {
+ page_offset += (int)num_subtitle_streams;
}
nb.show_all();