Mercurial > mplayer.hg
comparison libmpdemux/demux_ogg.c @ 21038:bfd340cdac88
Generalize subtitle switching, demux_ogg does not need a special case
anymore and demux_mov works now, too.
author | reimar |
---|---|
date | Sun, 19 Nov 2006 14:23:54 +0000 |
parents | cdf75ea331c9 |
children | 493b34d15885 |
comparison
equal
deleted
inserted
replaced
21037:a7ffbe50d77a | 21038:bfd340cdac88 |
---|---|
486 ogg_d->text_langs[index] = strdup(val); | 486 ogg_d->text_langs[index] = strdup(val); |
487 } | 487 } |
488 // check for -slang if subs are uninitialized yet | 488 // check for -slang if subs are uninitialized yet |
489 if (os->text && d->sub->id < 0 && demux_ogg_check_lang(val, dvdsub_lang)) | 489 if (os->text && d->sub->id < 0 && demux_ogg_check_lang(val, dvdsub_lang)) |
490 { | 490 { |
491 d->sub->id = id; | 491 d->sub->id = index; |
492 dvdsub_id = index; | 492 dvdsub_id = index; |
493 mp_msg(MSGT_DEMUX, MSGL_V, "Ogg demuxer: Displaying subtitle stream id %d which matched -slang %s\n", id, val); | 493 mp_msg(MSGT_DEMUX, MSGL_V, "Ogg demuxer: Displaying subtitle stream id %d which matched -slang %s\n", id, val); |
494 } | 494 } |
495 else | 495 else |
496 hdr = "Language"; | 496 hdr = "Language"; |
536 demux_ogg_check_comments(d, os, id, &vc); | 536 demux_ogg_check_comments(d, os, id, &vc); |
537 vorbis_comment_clear(&vc); | 537 vorbis_comment_clear(&vc); |
538 vorbis_info_clear(&vi); | 538 vorbis_info_clear(&vi); |
539 } | 539 } |
540 if (os->text) { | 540 if (os->text) { |
541 if (id == d->sub->id) // don't want to add subtitles to the demuxer for now | 541 if (id == demux_ogg_sub_id(d->sub->id)) // don't want to add subtitles to the demuxer for now |
542 demux_ogg_add_sub(os,pack); | 542 demux_ogg_add_sub(os,pack); |
543 return 0; | 543 return 0; |
544 } | 544 } |
545 if (os->speex) { | 545 if (os->speex) { |
546 // discard first two packets, they contain the header and comment | 546 // discard first two packets, they contain the header and comment |
715 extern void print_wave_header(WAVEFORMATEX *h, int verbose_level); | 715 extern void print_wave_header(WAVEFORMATEX *h, int verbose_level); |
716 extern void print_video_header(BITMAPINFOHEADER *h, int verbose_level); | 716 extern void print_video_header(BITMAPINFOHEADER *h, int verbose_level); |
717 | 717 |
718 /* defined in demux_mov.c */ | 718 /* defined in demux_mov.c */ |
719 extern unsigned int store_ughvlc(unsigned char *s, unsigned int v); | 719 extern unsigned int store_ughvlc(unsigned char *s, unsigned int v); |
720 | |
721 /** \brief Return the number of subtitle tracks in the file. | |
722 | |
723 \param demuxer The demuxer for which the number of subtitle tracks | |
724 should be returned. | |
725 */ | |
726 int demux_ogg_num_subs(demuxer_t *demuxer) { | |
727 ogg_demuxer_t *ogg_d = (ogg_demuxer_t *)demuxer->priv; | |
728 return ogg_d->n_text; | |
729 } | |
730 | 720 |
731 /** \brief Change the current subtitle stream and return its ID. | 721 /** \brief Change the current subtitle stream and return its ID. |
732 | 722 |
733 \param demuxer The demuxer whose subtitle stream will be changed. | 723 \param demuxer The demuxer whose subtitle stream will be changed. |
734 \param new_num The number of the new subtitle track. The number must be | 724 \param new_num The number of the new subtitle track. The number must be |