Mercurial > mplayer.hg
comparison Gui/mplayer/gtk/menu.c @ 19540:70a5e89ea4cd
Get rid of demux_aid_vid_mismatch mess.
author | reimar |
---|---|
date | Sat, 26 Aug 2006 19:17:04 +0000 |
parents | 0d191b783ed1 |
children | a7e5b99ac083 |
comparison
equal
deleted
inserted
replaced
19539:64009ae411fb | 19540:70a5e89ea4cd |
---|---|
14 #include "../widgets.h" | 14 #include "../widgets.h" |
15 #include "app.h" | 15 #include "app.h" |
16 | 16 |
17 #include "../../stream/stream.h" | 17 #include "../../stream/stream.h" |
18 #include "../../libmpdemux/demuxer.h" | 18 #include "../../libmpdemux/demuxer.h" |
19 #include "../../libmpdemux/stheader.h" | |
19 | 20 |
20 #include "../pixmaps/ab.xpm" | 21 #include "../pixmaps/ab.xpm" |
21 #include "../pixmaps/half.xpm" | 22 #include "../pixmaps/half.xpm" |
22 #include "../pixmaps/normal.xpm" | 23 #include "../pixmaps/normal.xpm" |
23 #include "../pixmaps/double.xpm" | 24 #include "../pixmaps/double.xpm" |
544 for ( i=0;i < MAX_A_STREAMS;i++ ) | 545 for ( i=0;i < MAX_A_STREAMS;i++ ) |
545 if ( ((demuxer_t *)guiIntfStruct.demuxer)->a_streams[i] ) c++; | 546 if ( ((demuxer_t *)guiIntfStruct.demuxer)->a_streams[i] ) c++; |
546 | 547 |
547 if ( c > 1 ) | 548 if ( c > 1 ) |
548 { | 549 { |
549 int basedec = 0; | |
550 int setdec = 0; | |
551 SubMenu=AddSubMenu( window1, (const char*)empty_xpm, Menu,MSGTR_MENU_AudioTrack ); | 550 SubMenu=AddSubMenu( window1, (const char*)empty_xpm, Menu,MSGTR_MENU_AudioTrack ); |
552 for ( i=0;i < MAX_A_STREAMS;i++ ) | 551 for ( i=0;i < MAX_A_STREAMS;i++ ) |
553 if ( ((demuxer_t *)guiIntfStruct.demuxer)->a_streams[i] ) | 552 if ( ((demuxer_t *)guiIntfStruct.demuxer)->a_streams[i] ) |
554 { | 553 { |
554 int aid = ((sh_audio_t *)((demuxer_t *)guiIntfStruct.demuxer)->a_streams[i])->aid; | |
555 char tmp[32]; | 555 char tmp[32]; |
556 if (!(setdec) ) | 556 snprintf( tmp,32,MSGTR_MENU_Track,aid ); |
557 { | 557 AddMenuItem( window1, (const char*)empty_xpm, SubMenu,tmp,( aid << 16 ) + evSetAudio ); |
558 basedec = (i > 1 ? i : 1); | |
559 setdec = 1; | |
560 } | |
561 snprintf( tmp,32,MSGTR_MENU_Track,(i-(basedec-1)) ); | |
562 AddMenuItem( window1, (const char*)empty_xpm, SubMenu,tmp,( (i-basedec) << 16 ) + evSetAudio ); | |
563 } | 558 } |
564 } | 559 } |
565 | 560 |
566 for ( c=0,i=0;i < MAX_V_STREAMS;i++ ) | 561 for ( c=0,i=0;i < MAX_V_STREAMS;i++ ) |
567 if ( ((demuxer_t *)guiIntfStruct.demuxer)->v_streams[i] ) c++; | 562 if ( ((demuxer_t *)guiIntfStruct.demuxer)->v_streams[i] ) c++; |
570 { | 565 { |
571 SubMenu=AddSubMenu( window1, (const char*)empty_xpm, Menu,MSGTR_MENU_VideoTrack ); | 566 SubMenu=AddSubMenu( window1, (const char*)empty_xpm, Menu,MSGTR_MENU_VideoTrack ); |
572 for ( i=0;i < MAX_V_STREAMS;i++ ) | 567 for ( i=0;i < MAX_V_STREAMS;i++ ) |
573 if ( ((demuxer_t *)guiIntfStruct.demuxer)->v_streams[i] ) | 568 if ( ((demuxer_t *)guiIntfStruct.demuxer)->v_streams[i] ) |
574 { | 569 { |
570 int vid = ((sh_video_t *)((demuxer_t *)guiIntfStruct.demuxer)->v_streams[i])->vid; | |
575 char tmp[32]; | 571 char tmp[32]; |
576 snprintf( tmp,32,MSGTR_MENU_Track,i ); | 572 snprintf( tmp,32,MSGTR_MENU_Track,vid ); |
577 AddMenuItem( window1, (const char*)empty_xpm, SubMenu,tmp,( i << 16 ) + evSetVideo ); | 573 AddMenuItem( window1, (const char*)empty_xpm, SubMenu,tmp,( vid << 16 ) + evSetVideo ); |
578 } | 574 } |
579 } | 575 } |
580 } | 576 } |
581 | 577 |
582 /* cheap subtitle switching for non-DVD streams */ | 578 /* cheap subtitle switching for non-DVD streams */ |