comparison mpegts.c @ 5337:9a3338ab7453 libavformat

Support demuxing teletext in DVB streams. Original patch by Francesco Lavra, francescolavra interfree it
author cehoyos
date Thu, 29 Oct 2009 10:46:16 +0000
parents ca4d9e153f56
children a5c67b592c53
comparison
equal deleted inserted replaced
5336:a0cee80f5597 5337:9a3338ab7453
533 /* descriptor present */ 533 /* descriptor present */
534 static const StreamType DESC_types[] = { 534 static const StreamType DESC_types[] = {
535 { 0x6a, CODEC_TYPE_AUDIO, CODEC_ID_AC3 }, /* AC-3 descriptor */ 535 { 0x6a, CODEC_TYPE_AUDIO, CODEC_ID_AC3 }, /* AC-3 descriptor */
536 { 0x7a, CODEC_TYPE_AUDIO, CODEC_ID_EAC3 }, /* E-AC-3 descriptor */ 536 { 0x7a, CODEC_TYPE_AUDIO, CODEC_ID_EAC3 }, /* E-AC-3 descriptor */
537 { 0x7b, CODEC_TYPE_AUDIO, CODEC_ID_DTS }, 537 { 0x7b, CODEC_TYPE_AUDIO, CODEC_ID_DTS },
538 { 0x56, CODEC_TYPE_SUBTITLE, CODEC_ID_DVB_TELETEXT },
538 { 0x59, CODEC_TYPE_SUBTITLE, CODEC_ID_DVB_SUBTITLE }, /* subtitling descriptor */ 539 { 0x59, CODEC_TYPE_SUBTITLE, CODEC_ID_DVB_SUBTITLE }, /* subtitling descriptor */
539 { 0 }, 540 { 0 },
540 }; 541 };
541 542
542 static void mpegts_find_stream_type(AVStream *st, 543 static void mpegts_find_stream_type(AVStream *st,
727 if (st->codec->codec_id == CODEC_ID_NONE && 728 if (st->codec->codec_id == CODEC_ID_NONE &&
728 stream_type == STREAM_TYPE_PRIVATE_DATA) 729 stream_type == STREAM_TYPE_PRIVATE_DATA)
729 mpegts_find_stream_type(st, desc_tag, DESC_types); 730 mpegts_find_stream_type(st, desc_tag, DESC_types);
730 731
731 switch(desc_tag) { 732 switch(desc_tag) {
733 case 0x56: /* DVB teletext descriptor */
734 language[0] = get8(&p, desc_end);
735 language[1] = get8(&p, desc_end);
736 language[2] = get8(&p, desc_end);
737 language[3] = 0;
738 av_metadata_set(&st->metadata, "language", language);
739 break;
732 case 0x59: /* subtitling descriptor */ 740 case 0x59: /* subtitling descriptor */
733 language[0] = get8(&p, desc_end); 741 language[0] = get8(&p, desc_end);
734 language[1] = get8(&p, desc_end); 742 language[1] = get8(&p, desc_end);
735 language[2] = get8(&p, desc_end); 743 language[2] = get8(&p, desc_end);
736 language[3] = 0; 744 language[3] = 0;