[FFmpeg-devel] [PATCH] Windows Television (.wtv) demuxer
Michael Niedermayer
michaelni
Wed Aug 4 16:26:51 CEST 2010
On Sat, Jul 31, 2010 at 04:25:22PM +1000, Peter Ross wrote:
> Yet another streaming to disk format.
>
> Samples here: samples.mplayerhq.hu/wtv
>
> -- Peter
> (A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
> asf.h | 2 +
> asfdec.c | 82 +++++++++++++++++++++++++++++++--------------------------------
> 2 files changed, 43 insertions(+), 41 deletions(-)
> 554c5894df055e401081a0532dd3da54d5fc221b guids.diff
ok
[...]
> + len = get_le32(pb);
> + sid = get_le32(pb) & 0x7F;
> + url_fskip(pb, 8);
> + consumed = 0x20;
> +
> + if (!ff_guidcmp(g, stream_guid)) {
> + int tag, size;
> + st = av_new_stream(s, sid);
> + if (!st)
> + return AVERROR(ENOMEM);
> +
> + url_fskip(pb, 28);
> + tag = get_le32(pb);
> + consumed += 32;
> +
> + switch(tag) {
> + case MKTAG('a','u','d','s'):
> + url_fskip(pb, 0x38);
> + size = get_le32(pb);
> + ff_get_wav_header(pb, st->codec, size);
> + consumed += 0x3C + size;
> + break;
> + case MKTAG('v','i','d','s'):
> + url_fskip(pb, 0xAC);
> + st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
> + st->codec->codec_id = ff_codec_get_id(video_tags, get_le32(pb));
> + consumed += 0xB0;
what are all these skiped bytes?
> + break;
> + case 0xE06D8020:
> + st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE;
> + st->codec->codec_id = CODEC_ID_DVB_SUBTITLE;
> + break;
> + default:
> + st->codec->codec_type = AVMEDIA_TYPE_UNKNOWN;
> + st->codec->codec_id = CODEC_ID_PROBE;
> + break;
> + }
> + st->need_parsing = AVSTREAM_PARSE_FULL;
> + av_set_pts_info(st, 64, 1, 10000000);
> +
> + } else if (!ff_guidcmp(g, subtitle_guid)) {
> + int stream_index = find_stream_index(s, sid);
> + if (stream_index < 0) {
> + av_log(s, AV_LOG_WARNING, "unidentified stream 0x%x\n", sid);
> + } else {
> + AVStream *st = s->streams[stream_index];
> +
> + url_fskip(pb, 10);
> + get_buffer(pb, st->language, 3);
> + st->language[3] = 0;
> + url_fskip(pb, 1);
> +
> + st->codec->extradata = av_malloc(4);
> + if (!st->codec->extradata)
> + return AVERROR(ENOMEM);
> + st->codec->extradata_size = get_buffer(pb, st->codec->extradata, 4);
> + consumed += 18;
> + }
> +
> + } else if (!ff_guidcmp(g, language_guid)) {
> + int stream_index = find_stream_index(s, sid);
> + if (stream_index < 0) {
> + av_log(s, AV_LOG_WARNING, "unidentified stream 0x%x\n", sid);
> + } else {
> + AVStream *st = s->streams[stream_index];
> + url_fskip(pb, 12);
> + get_buffer(pb, st->language, 3);
> + st->language[3] = 0;
> + consumed += 15;
> + }
> + } else if (!ff_guidcmp(g, timing_guid)) {
> +/* FIXME: Stream and timing/data guids are sometimes interleaved, so we must
> + continue to interate through the file, until sufficient streams are identified.
> + Solution: perform av_new_stream() within read_packet */
yes fix this please, av_find_stream_info() is well able to handle later added
streams
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
If a bugfix only changes things apparently unrelated to the bug with no
further explanation, that is a good sign that the bugfix is wrong.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100804/0c9e021d/attachment.pgp>
More information about the ffmpeg-devel
mailing list