# HG changeset patch # User kostya # Date 1192987280 0 # Node ID 37484d33208796b8def3ac5665832b044e8da4d3 # Parent 67667d13bab5c85c79e5f152412d04affc9baad6 Make Matroska demuxer output full frames instead of slices for RealVideo Patch by Aurelien Jacobs (aurel at "... is not unix"age.org) Thread [RFC] Feed whole frames to RV* decoders diff -r 67667d13bab5 -r 37484d332087 matroska.h --- a/matroska.h Sun Oct 21 17:17:28 2007 +0000 +++ b/matroska.h Sun Oct 21 17:21:20 2007 +0000 @@ -169,7 +169,6 @@ MATROSKA_TRACK_ENABLED = (1<<0), MATROSKA_TRACK_DEFAULT = (1<<1), MATROSKA_TRACK_LACING = (1<<2), - MATROSKA_TRACK_REAL_V = (1<<4), MATROSKA_TRACK_SHIFT = (1<<16) } MatroskaTrackFlags; diff -r 67667d13bab5 -r 37484d332087 matroskadec.c --- a/matroskadec.c Sun Oct 21 17:17:28 2007 +0000 +++ b/matroskadec.c Sun Oct 21 17:21:20 2007 +0000 @@ -2110,7 +2110,6 @@ codec_id == CODEC_ID_RV30 || codec_id == CODEC_ID_RV40) { extradata_offset = 26; track->codec_priv_size -= extradata_offset; - track->flags |= MATROSKA_TRACK_REAL_V; } else if (codec_id == CODEC_ID_RA_144) { @@ -2237,12 +2236,6 @@ return res; } -static inline int -rv_offset(uint8_t *data, int slice, int slices) -{ - return AV_RL32(data+8*slice+4) + 8*slices; -} - static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data, int size, int64_t pos, uint64_t cluster_time, uint64_t duration, @@ -2379,7 +2372,6 @@ } if (res == 0) { - int real_v = matroska->tracks[track]->flags & MATROSKA_TRACK_REAL_V; uint64_t timecode = AV_NOPTS_VALUE; if (cluster_time != (uint64_t)-1 @@ -2387,22 +2379,6 @@ timecode = cluster_time + block_time; for (n = 0; n < laces; n++) { - int slice, slices = 1; - - if (real_v) { - slices = *data++ + 1; - lace_size[n]--; - } - - for (slice=0; slicecodec->codec_id == CODEC_ID_RA_288 || st->codec->codec_id == CODEC_ID_COOK || st->codec->codec_id == CODEC_ID_ATRAC3) { @@ -2444,19 +2420,19 @@ if (st->codec->codec_id == CODEC_ID_TEXT && ((MatroskaSubtitleTrack *)(matroska->tracks[track]))->ass) { int i; - for (i=0; i<8 && data[slice_offset+offset]; offset++) - if (data[slice_offset+offset] == ',') + for (i=0; i<8 && data[offset]; offset++) + if (data[offset] == ',') i++; } pkt = av_mallocz(sizeof(AVPacket)); /* XXX: prevent data copy... */ - if (av_new_packet(pkt, slice_size-offset) < 0) { + if (av_new_packet(pkt, lace_size[n]-offset) < 0) { res = AVERROR(ENOMEM); n = laces-1; break; } - memcpy (pkt->data, data+slice_offset+offset, slice_size-offset); + memcpy (pkt->data, data+offset, lace_size[n]-offset); if (n == 0) pkt->flags = is_keyframe; @@ -2471,7 +2447,6 @@ if (timecode != AV_NOPTS_VALUE) timecode = duration ? timecode + duration : AV_NOPTS_VALUE; - } data += lace_size[n]; } }