comparison libmpdemux/demuxer.c @ 4765:d0c2c8af46b4

Demuxers demuxer support for using external audiofile (or muxed subtitles). Options registration for libmpdemux. Demuxer info query.
author albeu
date Wed, 20 Feb 2002 16:59:25 +0000
parents 21eca91fece7
children 64bf084309cf
comparison
equal deleted inserted replaced
4764:9579496a91db 4765:d0c2c8af46b4
9 #include <sys/stat.h> 9 #include <sys/stat.h>
10 10
11 #include "config.h" 11 #include "config.h"
12 #include "mp_msg.h" 12 #include "mp_msg.h"
13 #include "help_mp.h" 13 #include "help_mp.h"
14 #include "../cfgparser.h"
14 15
15 #include "stream.h" 16 #include "stream.h"
16 #include "demuxer.h" 17 #include "demuxer.h"
17 #include "stheader.h" 18 #include "stheader.h"
18 #include "mf.h" 19 #include "mf.h"
190 extern int demux_tv_fill_buffer(demuxer_t *demux, tvi_handle_t *tvh); 191 extern int demux_tv_fill_buffer(demuxer_t *demux, tvi_handle_t *tvh);
191 extern int demux_open_tv(demuxer_t *demuxer, tvi_handle_t *tvh); 192 extern int demux_open_tv(demuxer_t *demuxer, tvi_handle_t *tvh);
192 #endif 193 #endif
193 int demux_y4m_fill_buffer(demuxer_t *demux); 194 int demux_y4m_fill_buffer(demuxer_t *demux);
194 int demux_audio_fill_buffer(demux_stream_t *ds); 195 int demux_audio_fill_buffer(demux_stream_t *ds);
196 extern int demux_demuxers_fill_buffer(demuxer_t *demux,demux_stream_t *ds);
195 197
196 int demux_fill_buffer(demuxer_t *demux,demux_stream_t *ds){ 198 int demux_fill_buffer(demuxer_t *demux,demux_stream_t *ds){
197 // Note: parameter 'ds' can be NULL! 199 // Note: parameter 'ds' can be NULL!
198 // printf("demux->type=%d\n",demux->type); 200 // printf("demux->type=%d\n",demux->type);
199 switch(demux->type){ 201 switch(demux->type){
214 #ifdef USE_TV 216 #ifdef USE_TV
215 case DEMUXER_TYPE_TV: return demux_tv_fill_buffer(demux, tv_handler); 217 case DEMUXER_TYPE_TV: return demux_tv_fill_buffer(demux, tv_handler);
216 #endif 218 #endif
217 case DEMUXER_TYPE_Y4M: return demux_y4m_fill_buffer(demux); 219 case DEMUXER_TYPE_Y4M: return demux_y4m_fill_buffer(demux);
218 case DEMUXER_TYPE_AUDIO: return demux_audio_fill_buffer(ds); 220 case DEMUXER_TYPE_AUDIO: return demux_audio_fill_buffer(ds);
221 case DEMUXER_TYPE_DEMUXERS: return demux_demuxers_fill_buffer(demux,ds);
219 } 222 }
220 return 0; 223 return 0;
221 } 224 }
222 225
223 // return value: 226 // return value:
406 409
407 extern int nuv_check_file(demuxer_t *demuxer); 410 extern int nuv_check_file(demuxer_t *demuxer);
408 extern void demux_open_nuv(demuxer_t *demuxer); 411 extern void demux_open_nuv(demuxer_t *demuxer);
409 extern int demux_audio_open(demuxer_t* demuxer); 412 extern int demux_audio_open(demuxer_t* demuxer);
410 413
411 demuxer_t* demux_open(stream_t *stream,int file_format,int audio_id,int video_id,int dvdsub_id){ 414
415 static demuxer_t* demux_open_stream(stream_t *stream,int file_format,int audio_id,int video_id,int dvdsub_id){
412 416
413 //int file_format=(*file_format_ptr); 417 //int file_format=(*file_format_ptr);
414 418
415 demuxer_t *demuxer=NULL; 419 demuxer_t *demuxer=NULL;
416 420
447 stream_read_dword_le(demuxer->stream); //filesize 451 stream_read_dword_le(demuxer->stream); //filesize
448 id=stream_read_dword_le(demuxer->stream); // "AVI " 452 id=stream_read_dword_le(demuxer->stream); // "AVI "
449 if(id==formtypeAVI){ 453 if(id==formtypeAVI){
450 mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_DetectedAVIfile); 454 mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_DetectedAVIfile);
451 file_format=DEMUXER_TYPE_AVI; 455 file_format=DEMUXER_TYPE_AVI;
452 } else 456 } else {
453 free_demuxer(demuxer); 457 free_demuxer(demuxer);
458 demuxer = NULL;
459 }
454 } 460 }
455 } 461 }
456 } 462 }
457 //=============== Try to open as Y4M file: ================= 463 //=============== Try to open as Y4M file: =================
458 if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_Y4M){ 464 if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_Y4M){
459 demuxer=new_demuxer(stream,DEMUXER_TYPE_Y4M,audio_id,video_id,dvdsub_id); 465 demuxer=new_demuxer(stream,DEMUXER_TYPE_Y4M,audio_id,video_id,dvdsub_id);
460 if(y4m_check_file(demuxer)){ 466 if(y4m_check_file(demuxer)){
461 mp_msg(MSGT_DEMUXER,MSGL_INFO,"Detected YUV4MPEG2 file format!\n"); 467 mp_msg(MSGT_DEMUXER,MSGL_INFO,"Detected YUV4MPEG2 file format!\n");
462 file_format=DEMUXER_TYPE_Y4M; 468 file_format=DEMUXER_TYPE_Y4M;
463 } else 469 } else {
464 free_demuxer(demuxer); 470 free_demuxer(demuxer);
471 demuxer = NULL;
472 }
465 } 473 }
466 //=============== Try to open as ASF file: ================= 474 //=============== Try to open as ASF file: =================
467 if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_ASF){ 475 if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_ASF){
468 demuxer=new_demuxer(stream,DEMUXER_TYPE_ASF,audio_id,video_id,dvdsub_id); 476 demuxer=new_demuxer(stream,DEMUXER_TYPE_ASF,audio_id,video_id,dvdsub_id);
469 if(asf_check_header(demuxer)){ 477 if(asf_check_header(demuxer)){
470 mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_DetectedASFfile); 478 mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_DetectedASFfile);
471 file_format=DEMUXER_TYPE_ASF; 479 file_format=DEMUXER_TYPE_ASF;
472 } else 480 } else {
473 free_demuxer(demuxer); 481 free_demuxer(demuxer);
482 demuxer = NULL;
483 }
474 } 484 }
475 //=============== Try to open as NUV file: ================= 485 //=============== Try to open as NUV file: =================
476 if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_NUV){ 486 if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_NUV){
477 demuxer=new_demuxer(stream,DEMUXER_TYPE_NUV,audio_id,video_id,dvdsub_id); 487 demuxer=new_demuxer(stream,DEMUXER_TYPE_NUV,audio_id,video_id,dvdsub_id);
478 if(nuv_check_file(demuxer)){ 488 if(nuv_check_file(demuxer)){
479 mp_msg(MSGT_DEMUXER,MSGL_INFO,"Detected NuppelVideo file format!\n"); 489 mp_msg(MSGT_DEMUXER,MSGL_INFO,"Detected NuppelVideo file format!\n");
480 file_format=DEMUXER_TYPE_NUV; 490 file_format=DEMUXER_TYPE_NUV;
481 } else 491 } else {
482 free_demuxer(demuxer); 492 free_demuxer(demuxer);
493 demuxer = NULL;
494 }
483 } 495 }
484 //=============== Try to open as MOV file: ================= 496 //=============== Try to open as MOV file: =================
485 if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_MOV){ 497 if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_MOV){
486 demuxer=new_demuxer(stream,DEMUXER_TYPE_MOV,audio_id,video_id,dvdsub_id); 498 demuxer=new_demuxer(stream,DEMUXER_TYPE_MOV,audio_id,video_id,dvdsub_id);
487 if(mov_check_file(demuxer)){ 499 if(mov_check_file(demuxer)){
488 mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_DetectedQTMOVfile); 500 mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_DetectedQTMOVfile);
489 file_format=DEMUXER_TYPE_MOV; 501 file_format=DEMUXER_TYPE_MOV;
490 } else 502 } else {
491 free_demuxer(demuxer); 503 free_demuxer(demuxer);
504 demuxer = NULL;
505 }
492 } 506 }
493 //=============== Try to open as VIVO file: ================= 507 //=============== Try to open as VIVO file: =================
494 if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_VIVO){ 508 if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_VIVO){
495 demuxer=new_demuxer(stream,DEMUXER_TYPE_VIVO,audio_id,video_id,dvdsub_id); 509 demuxer=new_demuxer(stream,DEMUXER_TYPE_VIVO,audio_id,video_id,dvdsub_id);
496 if(vivo_check_file(demuxer)){ 510 if(vivo_check_file(demuxer)){
497 mp_msg(MSGT_DEMUXER,MSGL_INFO,"Detected VIVO file format!\n"); 511 mp_msg(MSGT_DEMUXER,MSGL_INFO,"Detected VIVO file format!\n");
498 file_format=DEMUXER_TYPE_VIVO; 512 file_format=DEMUXER_TYPE_VIVO;
513 } else {
514 free_demuxer(demuxer);
515 demuxer = NULL;
499 } 516 }
500 } 517 }
501 //=============== Try to open as REAL file: ================= 518 //=============== Try to open as REAL file: =================
502 if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_REAL){ 519 if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_REAL){
503 demuxer=new_demuxer(stream,DEMUXER_TYPE_REAL,audio_id,video_id,dvdsub_id); 520 demuxer=new_demuxer(stream,DEMUXER_TYPE_REAL,audio_id,video_id,dvdsub_id);
504 if(real_check_file(demuxer)){ 521 if(real_check_file(demuxer)){
505 mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_DetectedREALfile); 522 mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_DetectedREALfile);
506 file_format=DEMUXER_TYPE_REAL; 523 file_format=DEMUXER_TYPE_REAL;
507 } else 524 } else {
508 free_demuxer(demuxer); 525 free_demuxer(demuxer);
526 demuxer = NULL;
527 }
509 } 528 }
510 //=============== Try to open as FLI file: ================= 529 //=============== Try to open as FLI file: =================
511 if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_FLI){ 530 if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_FLI){
512 demuxer=new_demuxer(stream,DEMUXER_TYPE_FLI,audio_id,video_id,dvdsub_id); 531 demuxer=new_demuxer(stream,DEMUXER_TYPE_FLI,audio_id,video_id,dvdsub_id);
513 { 532 {
516 id=stream_read_word_le(demuxer->stream); 535 id=stream_read_word_le(demuxer->stream);
517 // check for the FLI file magic number 536 // check for the FLI file magic number
518 if((id==0xAF11) || (id==0xAF12)){ 537 if((id==0xAF11) || (id==0xAF12)){
519 mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_DetectedFLIfile); 538 mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_DetectedFLIfile);
520 file_format=DEMUXER_TYPE_FLI; 539 file_format=DEMUXER_TYPE_FLI;
521 } else 540 } else {
522 free_demuxer(demuxer); 541 free_demuxer(demuxer);
542 demuxer = NULL;
543 }
523 } 544 }
524 } 545 }
525 //=============== Try to open as FILM file: ================= 546 //=============== Try to open as FILM file: =================
526 if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_FILM){ 547 if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_FILM){
527 demuxer=new_demuxer(stream,DEMUXER_TYPE_FILM,audio_id,video_id,dvdsub_id); 548 demuxer=new_demuxer(stream,DEMUXER_TYPE_FILM,audio_id,video_id,dvdsub_id);
529 int signature=stream_read_fourcc(demuxer->stream); 550 int signature=stream_read_fourcc(demuxer->stream);
530 // check for the FLI file magic number 551 // check for the FLI file magic number
531 if(signature==mmioFOURCC('F', 'I', 'L', 'M')){ 552 if(signature==mmioFOURCC('F', 'I', 'L', 'M')){
532 mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_DetectedFILMfile); 553 mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_DetectedFILMfile);
533 file_format=DEMUXER_TYPE_FILM; 554 file_format=DEMUXER_TYPE_FILM;
534 } else 555 } else {
535 free_demuxer(demuxer); 556 free_demuxer(demuxer);
557 demuxer = NULL;
558 }
536 } 559 }
537 } 560 }
538 //=============== Try to open as RoQ file: ================= 561 //=============== Try to open as RoQ file: =================
539 if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_ROQ){ 562 if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_ROQ){
540 demuxer=new_demuxer(stream,DEMUXER_TYPE_ROQ,audio_id,video_id,dvdsub_id); 563 demuxer=new_demuxer(stream,DEMUXER_TYPE_ROQ,audio_id,video_id,dvdsub_id);
541 if(roq_check_file(demuxer)){ 564 if(roq_check_file(demuxer)){
542 mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_DetectedROQfile); 565 mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_DetectedROQfile);
543 file_format=DEMUXER_TYPE_ROQ; 566 file_format=DEMUXER_TYPE_ROQ;
544 } else 567 } else {
545 free_demuxer(demuxer); 568 free_demuxer(demuxer);
569 demuxer = NULL;
570 }
546 } 571 }
547 //=============== Try to open as MPEG-PS file: ================= 572 //=============== Try to open as MPEG-PS file: =================
548 if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_MPEG_PS){ 573 if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_MPEG_PS){
549 int pes=1; 574 int pes=1;
550 int tmp; 575 int tmp;
589 if(demuxer->synced==2) 614 if(demuxer->synced==2)
590 mp_msg(MSGT_DEMUXER,MSGL_ERR,"MPEG: " MSGTR_MissingVideoStreamBug); 615 mp_msg(MSGT_DEMUXER,MSGL_ERR,"MPEG: " MSGTR_MissingVideoStreamBug);
591 else 616 else
592 mp_msg(MSGT_DEMUXER,MSGL_V,"Not MPEG System Stream format... (maybe Transport Stream?)\n"); 617 mp_msg(MSGT_DEMUXER,MSGL_V,"Not MPEG System Stream format... (maybe Transport Stream?)\n");
593 free_demuxer(demuxer); 618 free_demuxer(demuxer);
619 demuxer = NULL;
594 } 620 }
595 } 621 }
596 break; 622 break;
597 } 623 }
598 } 624 }
601 demuxer=new_demuxer(stream,DEMUXER_TYPE_MPEG_ES,audio_id,video_id,dvdsub_id); 627 demuxer=new_demuxer(stream,DEMUXER_TYPE_MPEG_ES,audio_id,video_id,dvdsub_id);
602 if(!ds_fill_buffer(demuxer->video)){ 628 if(!ds_fill_buffer(demuxer->video)){
603 mp_msg(MSGT_DEMUXER,MSGL_ERR,MSGTR_InvalidMPEGES); 629 mp_msg(MSGT_DEMUXER,MSGL_ERR,MSGTR_InvalidMPEGES);
604 file_format=DEMUXER_TYPE_UNKNOWN; 630 file_format=DEMUXER_TYPE_UNKNOWN;
605 free_demuxer(demuxer); 631 free_demuxer(demuxer);
632 demuxer = NULL;
606 } else { 633 } else {
607 mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_DetectedMPEGESfile); 634 mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_DetectedMPEGESfile);
608 } 635 }
609 } 636 }
610 //=============== Try to open as multi file: ================= 637 //=============== Try to open as multi file: =================
622 if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_AUDIO){ 649 if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_AUDIO){
623 demuxer=new_demuxer(stream,DEMUXER_TYPE_AUDIO,audio_id,video_id,dvdsub_id); 650 demuxer=new_demuxer(stream,DEMUXER_TYPE_AUDIO,audio_id,video_id,dvdsub_id);
624 if(demux_audio_open(demuxer)){ 651 if(demux_audio_open(demuxer)){
625 mp_msg(MSGT_DEMUXER,MSGL_INFO,"Detected audio file\n"); 652 mp_msg(MSGT_DEMUXER,MSGL_INFO,"Detected audio file\n");
626 file_format=DEMUXER_TYPE_AUDIO; 653 file_format=DEMUXER_TYPE_AUDIO;
627 } else 654 } else {
628 free_demuxer(demuxer); 655 free_demuxer(demuxer);
656 demuxer = NULL;
657 }
629 } 658 }
630 //=============== Unknown, exiting... =========================== 659 //=============== Unknown, exiting... ===========================
631 if(file_format==DEMUXER_TYPE_UNKNOWN){ 660 if(file_format==DEMUXER_TYPE_UNKNOWN || demuxer == NULL){
632 mp_msg(MSGT_DEMUXER,MSGL_ERR,MSGTR_FormatNotRecognized); 661 mp_msg(MSGT_DEMUXER,MSGL_ERR,MSGTR_FormatNotRecognized);
633 return NULL; 662 return NULL;
634 // GUI_MSG( mplUnknowFileType ) 663 // GUI_MSG( mplUnknowFileType )
635 } 664 }
636 //====== File format recognized, set up these for compatibility: ========= 665 //====== File format recognized, set up these for compatibility: =========
758 } // switch(file_format) 787 } // switch(file_format)
759 pts_from_bps=0; // !!! 788 pts_from_bps=0; // !!!
760 return demuxer; 789 return demuxer;
761 } 790 }
762 791
792 static char* audio_stream = NULL;
793 static char* sub_stream = NULL;
794 static int demuxer_type = 0, audio_demuxer_type = 0, sub_demuxer_type = 0;
795 extern m_config_t* mconfig;
796
797 demuxer_t* demux_open(stream_t *vs,int file_format,int audio_id,int video_id,int dvdsub_id){
798 stream_t *as = NULL,*ss = NULL;
799 demuxer_t *vd,*ad = NULL,*sd = NULL;
800 int afmt = 0,sfmt = 0;
801
802 if(audio_stream) {
803 as = open_stream(audio_stream,0,&afmt);
804 if(!as) {
805 mp_msg(MSGT_DEMUXER,MSGL_ERR,"Can't open audio stream: %s\n",audio_stream);
806 return NULL;
807 }
808 }
809 if(sub_stream) {
810 ss = open_stream(sub_stream,0,&sfmt);
811 if(!ss) {
812 mp_msg(MSGT_DEMUXER,MSGL_ERR,"Can't open subtitles stream: %s\n",sub_stream);
813 return NULL;
814 }
815 }
816
817 vd = demux_open_stream(vs,demuxer_type ? demuxer_type : file_format,audio_stream ? -2 : audio_id,video_id, sub_stream ? -2 : dvdsub_id);
818 if(!vd)
819 return NULL;
820 if(as) {
821 ad = demux_open_stream(as,audio_demuxer_type ? audio_demuxer_type : afmt,audio_id,-2,-2);
822 if(!ad)
823 mp_msg(MSGT_DEMUXER,MSGL_WARN,"Failed to open audio demuxer: %s\n",audio_stream);
824 else if(ad->audio->sh && ((sh_audio_t*)ad->audio->sh)->format == 0x55) // MP3
825 m_config_set_flag(mconfig,"hr-mp3-seek",1); // Enable high res seeking
826 }
827 if(ss) {
828 sd = demux_open_stream(ss,sub_demuxer_type ? sub_demuxer_type : sfmt,-2,-2,dvdsub_id);
829 if(!sd)
830 mp_msg(MSGT_DEMUXER,MSGL_WARN,"Failed to open subtitles demuxer: %s\n",sub_stream);
831 }
832
833 if(ad && sd)
834 return new_demuxers_demuxer(vd,ad,sd);
835 else if(ad)
836 return new_demuxers_demuxer(vd,ad,vd);
837 else if(sd)
838 return new_demuxers_demuxer(vd,vd,sd);
839 else
840 return vd;
841 }
842
843
763 int demux_seek_avi(demuxer_t *demuxer,float rel_seek_secs,int flags); 844 int demux_seek_avi(demuxer_t *demuxer,float rel_seek_secs,int flags);
764 int demux_seek_asf(demuxer_t *demuxer,float rel_seek_secs,int flags); 845 int demux_seek_asf(demuxer_t *demuxer,float rel_seek_secs,int flags);
765 int demux_seek_mpg(demuxer_t *demuxer,float rel_seek_secs,int flags); 846 int demux_seek_mpg(demuxer_t *demuxer,float rel_seek_secs,int flags);
766 int demux_seek_y4m(demuxer_t *demuxer,float rel_seek_secs,int flags); 847 int demux_seek_y4m(demuxer_t *demuxer,float rel_seek_secs,int flags);
767 int demux_seek_fli(demuxer_t *demuxer,float rel_seek_secs,int flags); 848 int demux_seek_fli(demuxer_t *demuxer,float rel_seek_secs,int flags);
768 int demux_seek_mf(demuxer_t *demuxer,float rel_seek_secs,int flags); 849 int demux_seek_mf(demuxer_t *demuxer,float rel_seek_secs,int flags);
769 int demux_seek_nuv(demuxer_t *demuxer,float rel_seek_secs,int flags); 850 int demux_seek_nuv(demuxer_t *demuxer,float rel_seek_secs,int flags);
770 void demux_seek_mov(demuxer_t *demuxer,float pts,int flags); 851 void demux_seek_mov(demuxer_t *demuxer,float pts,int flags);
771 extern void demux_audio_seek(demuxer_t *demuxer,float rel_seek_secs,int flags); 852 extern void demux_audio_seek(demuxer_t *demuxer,float rel_seek_secs,int flags);
853 extern void demux_demuxers_seek(demuxer_t *demuxer,float rel_seek_secs,int flags);
772 854
773 int demux_seek(demuxer_t *demuxer,float rel_seek_secs,int flags){ 855 int demux_seek(demuxer_t *demuxer,float rel_seek_secs,int flags){
774 demux_stream_t *d_audio=demuxer->audio; 856 demux_stream_t *d_audio=demuxer->audio;
775 demux_stream_t *d_video=demuxer->video; 857 demux_stream_t *d_video=demuxer->video;
776 sh_audio_t *sh_audio=d_audio->sh; 858 sh_audio_t *sh_audio=d_audio->sh;
828 demux_seek_fli(demuxer,rel_seek_secs,flags); break; 910 demux_seek_fli(demuxer,rel_seek_secs,flags); break;
829 case DEMUXER_TYPE_NUV: 911 case DEMUXER_TYPE_NUV:
830 demux_seek_nuv(demuxer,rel_seek_secs,flags); break; 912 demux_seek_nuv(demuxer,rel_seek_secs,flags); break;
831 case DEMUXER_TYPE_AUDIO: 913 case DEMUXER_TYPE_AUDIO:
832 demux_audio_seek(demuxer,rel_seek_secs,flags); break; 914 demux_audio_seek(demuxer,rel_seek_secs,flags); break;
915 case DEMUXER_TYPE_DEMUXERS:
916 demux_demuxers_seek(demuxer,rel_seek_secs,flags); break;
833 917
834 918
835 } // switch(demuxer->file_format) 919 } // switch(demuxer->file_format)
836 920
837 return 1; 921 return 1;
872 for(n = 0; info[2*n] != NULL ; n++) 956 for(n = 0; info[2*n] != NULL ; n++)
873 mp_msg(MSGT_DEMUX, MSGL_INFO, " %s: %s\n",info[2*n],info[2*n+1]); 957 mp_msg(MSGT_DEMUX, MSGL_INFO, " %s: %s\n",info[2*n],info[2*n+1]);
874 958
875 return 0; 959 return 0;
876 } 960 }
961
962 char* demux_info_get(demuxer_t *demuxer, char *opt) {
963 int i;
964 char **info = demuxer->info;
965
966 for(i = 0; info && info[2*i] != NULL; i++) {
967 if(!strcasecmp(opt,info[2*i]))
968 return info[2*i+1];
969 }
970
971 return NULL;
972 }
973
974 /******************* Options stuff **********************/
975
976 static config_t demuxer_opts[] = {
977 { "audiofile", &audio_stream, CONF_TYPE_STRING, 0, 0, 0, NULL },
978 { "subfile", &sub_stream, CONF_TYPE_STRING, 0, 0, 0, NULL },
979 { "demuxer", &demuxer_type, CONF_TYPE_INT, CONF_RANGE, 1, DEMUXER_TYPE_MAX, NULL },
980 { "audio-demuxer", &audio_demuxer_type, CONF_TYPE_INT, CONF_RANGE, 1, DEMUXER_TYPE_MAX, NULL },
981 { "sub-demuxer", &sub_demuxer_type, CONF_TYPE_INT, CONF_RANGE, 1, DEMUXER_TYPE_MAX, NULL },
982 { NULL, NULL, 0, 0, 0, 0, NULL}
983 };
984
985 void demuxer_register_options(m_config_t* cfg) {
986 m_config_register_options(cfg,demuxer_opts);
987 }
988