Ticket #7804: codec_tag.patch
File codec_tag.patch, 1.6 KB (added by , 14 years ago) |
---|
-
libs/libavformat/mpegts.c
29 29 #include <pthread.h> 30 30 #include "mpegts.h" 31 31 #include "internal.h" 32 #include "riff.h" 32 33 33 34 /* 1.0 second at 24Mbit/s */ 34 35 #define MAX_SCAN_PACKETS 32000 … … 617 618 } 618 619 } 619 620 621 620 622 static AVStream *new_pes_av_stream(PESContext *pes, uint32_t prog_reg_desc, uint32_t code) 621 623 { 624 static const AVCodecTag mpeg_stream_tags[] = { 625 { STREAM_TYPE_VIDEO_MPEG1, MKTAG('m', 'p', 'g', '1') }, 626 { STREAM_TYPE_VIDEO_MPEG2, MKTAG('m', 'p', 'g', '2') }, 627 { STREAM_TYPE_VIDEO_MPEG4, MKTAG('M', 'P', 'G', '4') }, 628 { STREAM_TYPE_VIDEO_H264, MKTAG('H', '2', '6', '4') }, 629 { STREAM_TYPE_VIDEO_VC1, MKTAG('W', 'V', 'C', '1') }, 630 { STREAM_TYPE_VIDEO_DIRAC, MKTAG('d', 'r', 'a', 'c') }, 631 { 0, 0 } 632 }; 622 633 AVStream *st = av_new_stream(pes->stream, pes->pid); 634 uint idx; 623 635 624 636 if (!st) 625 637 return NULL; … … 634 646 dprintf(pes->stream, "stream_type=%x pid=%x prog_reg_desc=%.4s\n", 635 647 pes->stream_type, pes->pid, (char*)&prog_reg_desc); 636 648 637 st->codec->codec_tag = pes->stream_type; 649 // st->codec->codec_tag = pes->stream_type; 650 for (idx = 0; mpeg_stream_tags[idx].id && mpeg_stream_tags[idx].id != pes->stream_type; idx++ ) 651 { 652 } 653 st->codec->codec_tag = mpeg_stream_tags[idx].tag; 638 654 639 655 mpegts_find_stream_type(st, pes->stream_type, ISO_types); 640 656 if (prog_reg_desc == AV_RL32("HDMV") &&