[FFmpeg-devel] [PATCH] dts parser fails to parse DTS-HD Master streams due to changing frame size
Benjamin Larsson
banan
Wed Jun 11 09:23:03 CEST 2008
elupus wrote:
> On Tue, 10 Jun 2008 22:57:44 +0200, elupus wrote:
>
>
>> Hi,
>>
>> Currently the dts parser in lavc fails to parse dts-hd master streams due
>> to them having changing framesizes.
>>
>> For some reason the parser requries that the framesize's are equal. Can't
>> really see why that should be required. So this patch removes that
>> requirement.
>>
>> Joakim
>>
>
> This is getting silly..
> ------------------------------------------------------------------------
>
> Index: libavcodec/dca_parser.c
> ===================================================================
> --- libavcodec/dca_parser.c (revision 13738)
> +++ libavcodec/dca_parser.c (working copy)
> @@ -32,8 +32,6 @@
> typedef struct DCAParseContext {
> ParseContext pc;
> uint32_t lastmarker;
> - int size;
> - int framesize;
> } DCAParseContext;
>
> #define IS_MARKER(state, i, buf, buf_size) \
> @@ -73,13 +71,10 @@
> }
> if (start_found) {
> for (; i < buf_size; i++) {
> - pc1->size++;
> state = (state << 8) | buf[i];
> - if (state == pc1->lastmarker && IS_MARKER(state, i, buf, buf_size) && (!pc1->framesize || pc1->framesize == pc1->size)) {
> + if (state == pc1->lastmarker && IS_MARKER(state, i, buf, buf_size)) {
> pc->frame_start_found = 0;
> pc->state = -1;
> - pc1->framesize = pc1->size;
> - pc1->size = 0;
> return i - 3;
> }
> }
>
This might break some core streams. It might find markers at random and
send incomplete frames to the decoder. I guess the spec we have is
incomplete with regard to newer streams. I'll try to locate a problem
stream and see if this change breaks it.
MvH
Benjamin Larsson
More information about the ffmpeg-devel
mailing list