Mercurial > mplayer.hg
comparison libmpdemux/demux_lavf.c @ 24844:4559076416de
permit identification and selection of programs
author | nicodvb |
---|---|
date | Sat, 27 Oct 2007 19:12:59 +0000 |
parents | 2bd6d730782f |
children | 3dacff6ae67c |
comparison
equal
deleted
inserted
replaced
24843:2bd6d730782f | 24844:4559076416de |
---|---|
48 extern char *audio_lang; | 48 extern char *audio_lang; |
49 static unsigned int opt_probesize = 0; | 49 static unsigned int opt_probesize = 0; |
50 static unsigned int opt_analyzeduration = 0; | 50 static unsigned int opt_analyzeduration = 0; |
51 static char *opt_format; | 51 static char *opt_format; |
52 static char *opt_cryptokey; | 52 static char *opt_cryptokey; |
53 extern int ts_prog; | |
53 | 54 |
54 m_option_t lavfdopts_conf[] = { | 55 m_option_t lavfdopts_conf[] = { |
55 {"probesize", &(opt_probesize), CONF_TYPE_INT, CONF_RANGE, 32, INT_MAX, NULL}, | 56 {"probesize", &(opt_probesize), CONF_TYPE_INT, CONF_RANGE, 32, INT_MAX, NULL}, |
56 {"format", &(opt_format), CONF_TYPE_STRING, 0, 0, 0, NULL}, | 57 {"format", &(opt_format), CONF_TYPE_STRING, 0, 0, 0, NULL}, |
57 {"analyzeduration", &(opt_analyzeduration), CONF_TYPE_INT, CONF_RANGE, 0, INT_MAX, NULL}, | 58 {"analyzeduration", &(opt_analyzeduration), CONF_TYPE_INT, CONF_RANGE, 0, INT_MAX, NULL}, |
69 int sub_streams; | 70 int sub_streams; |
70 int64_t last_pts; | 71 int64_t last_pts; |
71 int astreams[MAX_A_STREAMS]; | 72 int astreams[MAX_A_STREAMS]; |
72 int vstreams[MAX_V_STREAMS]; | 73 int vstreams[MAX_V_STREAMS]; |
73 int sstreams[MAX_S_STREAMS]; | 74 int sstreams[MAX_S_STREAMS]; |
75 int cur_program; | |
74 }lavf_priv_t; | 76 }lavf_priv_t; |
75 | 77 |
76 extern void print_wave_header(WAVEFORMATEX *h, int verbose_level); | 78 extern void print_wave_header(WAVEFORMATEX *h, int verbose_level); |
77 extern void print_video_header(BITMAPINFOHEADER *h, int verbose_level); | 79 extern void print_video_header(BITMAPINFOHEADER *h, int verbose_level); |
78 | 80 |
489 if(avfc->album [0]) demux_info_add(demuxer, "album" , avfc->album ); | 491 if(avfc->album [0]) demux_info_add(demuxer, "album" , avfc->album ); |
490 // if(avfc->year ) demux_info_add(demuxer, "year" , avfc->year ); | 492 // if(avfc->year ) demux_info_add(demuxer, "year" , avfc->year ); |
491 // if(avfc->track ) demux_info_add(demuxer, "track" , avfc->track ); | 493 // if(avfc->track ) demux_info_add(demuxer, "track" , avfc->track ); |
492 if(avfc->genre [0]) demux_info_add(demuxer, "genre" , avfc->genre ); | 494 if(avfc->genre [0]) demux_info_add(demuxer, "genre" , avfc->genre ); |
493 | 495 |
496 if(avfc->nb_programs) { | |
497 int p, start=0, found=0; | |
498 | |
499 if(ts_prog) { | |
500 for(p=0; p<avfc->nb_programs; p++) { | |
501 if(avfc->programs[p]->id == ts_prog) { | |
502 start = p; | |
503 found = 1; | |
504 break; | |
505 } | |
506 } | |
507 if(!found) { | |
508 mp_msg(MSGT_HEADER,MSGL_ERR,"DEMUX_LAVF: program %d doesn't seem to be present\n", ts_prog); | |
509 return NULL; | |
510 } | |
511 } | |
512 p = start; | |
513 do { | |
514 AVProgram *program = avfc->programs[p]; | |
515 mp_msg(MSGT_HEADER,MSGL_INFO,"LAVF: Program %d %s\n", program->id, (program->name ? program->name : "")); | |
516 for(i=0; i<program->nb_stream_indexes; i++) | |
517 handle_stream(demuxer, avfc, program->stream_index[i]); | |
518 if(!priv->cur_program && (demuxer->video->sh || demuxer->audio->sh)) | |
519 priv->cur_program = program->id; | |
520 p = (p + 1) % avfc->nb_programs; | |
521 } while(p!=start); | |
522 } else | |
494 for(i=0; i<avfc->nb_streams; i++) | 523 for(i=0; i<avfc->nb_streams; i++) |
495 handle_stream(demuxer, avfc, i); | 524 handle_stream(demuxer, avfc, i); |
496 | 525 |
497 mp_msg(MSGT_HEADER,MSGL_V,"LAVF: %d audio and %d video streams found\n",priv->audio_streams,priv->video_streams); | 526 mp_msg(MSGT_HEADER,MSGL_V,"LAVF: %d audio and %d video streams found\n",priv->audio_streams,priv->video_streams); |
498 mp_msg(MSGT_HEADER,MSGL_V,"LAVF: build %d\n", LIBAVFORMAT_BUILD); | 527 mp_msg(MSGT_HEADER,MSGL_V,"LAVF: build %d\n", LIBAVFORMAT_BUILD); |