ALT Linux Bugzilla
– Attachment 1964 Details for
Bug 11760
DTS (DCA) decoding is broken
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
[PATCH 02] dtsdec: save flags, sample_rate, bit_rate in DTSContext
0002-dtsdec-save-flags-sample_rate-bit_rate-in-DTSCont.patch (text/plain), 2.71 KB, created by
Sergey Vlasov
on 2007-05-15 17:10:27 MSD
(
hide
)
Description:
[PATCH 02] dtsdec: save flags, sample_rate, bit_rate in DTSContext
Filename:
MIME Type:
Creator:
Sergey Vlasov
Created:
2007-05-15 17:10:27 MSD
Size:
2.71 KB
patch
obsolete
>From da97e88d62702a81508fd3c862164087936ccbb3 Mon Sep 17 00:00:00 2001 >From: Sergey Vlasov <vsu@altlinux.ru> >Date: Tue, 15 May 2007 14:21:33 +0400 >Subject: dtsdec: save flags, sample_rate, bit_rate in DTSContext > >Frame flags must be saved between calls to dts_decode_frame() (if the >input buffer did not hold a complete frame, flags for that frame will >be used by the next dts_decode_frame() call when the rest of frame >data is available). Fixes "dts_frame() failed" errors in mplayer due >to uninitialized garbage in flags. > >The sample_rate and bit_rate values also can be used by the next >dts_decode_frame() call; uninitialized values can lead to SIGFPE in >ffmpeg at the end of stream (when sample_rate == 0 is encountered). > >Signed-off-by: Sergey Vlasov <vsu@altlinux.ru> >--- > libavcodec/dtsdec.c | 15 ++++++++------- > 1 files changed, 8 insertions(+), 7 deletions(-) > >diff --git a/libavcodec/dtsdec.c b/libavcodec/dtsdec.c >index cf77a57..2a3c66a 100644 >--- a/libavcodec/dtsdec.c >+++ b/libavcodec/dtsdec.c >@@ -36,6 +36,9 @@ typedef struct DTSContext { > uint8_t buf[BUFFER_SIZE]; > uint8_t *bufptr; > uint8_t *bufpos; >+ int flags; >+ int sample_rate; >+ int bit_rate; > } DTSContext; > > static inline int16_t >@@ -173,10 +176,8 @@ dts_decode_frame(AVCodecContext * avctx, void *data, int *data_size, > uint8_t *start = buff; > uint8_t *end = buff + buff_size; > int16_t *out_samples = data; >- int sample_rate; > int frame_length; > int flags; >- int bit_rate; > int len; > level_t level; > sample_t bias; >@@ -201,8 +202,8 @@ dts_decode_frame(AVCodecContext * avctx, void *data, int *data_size, > if(s->bufpos != s->buf + HEADER_SIZE) > break; > >- length = dts_syncinfo(s->state, s->buf, &flags, &sample_rate, >- &bit_rate, &frame_length); >+ length = dts_syncinfo(s->state, s->buf, &s->flags, &s->sample_rate, >+ &s->bit_rate, &frame_length); > if(!length) { > av_log(NULL, AV_LOG_INFO, "skip\n"); > for(s->bufptr = s->buf; s->bufptr < s->buf + HEADER_SIZE - 1; s->bufptr++) >@@ -215,15 +216,15 @@ dts_decode_frame(AVCodecContext * avctx, void *data, int *data_size, > level = CONVERT_LEVEL; > bias = CONVERT_BIAS; > >- flags |= DTS_ADJUST_LEVEL; >+ flags = s->flags | DTS_ADJUST_LEVEL; > if(dts_frame(s->state, s->buf, &flags, &level, bias)) { > av_log(avctx, AV_LOG_ERROR, "dts_frame() failed\n"); > goto end; > } > >- avctx->sample_rate = sample_rate; >+ avctx->sample_rate = s->sample_rate; > avctx->channels = channels_multi(flags); >- avctx->bit_rate = bit_rate; >+ avctx->bit_rate = s->bit_rate; > > nblocks = dts_blocks_num(s->state); > >-- >1.5.1.1.197.g66b3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 11760
:
1961
|
1962
|
1963
| 1964 |
1969
|
1990