On Thu, May 07, 2015 at 01:48:02AM +0100, Vittorio Giovara wrote:
> --- a/libavcodec/dca_parser.c
> +++ b/libavcodec/dca_parser.c
> @@ -48,24 +55,25 @@ static int dca_find_frame_end(DCAParseContext
>          for (i = 0; i < buf_size; i++) {
>              state = (state << 8) | buf[i];
> -            if (IS_MARKER(state, i, buf, buf_size)) {
> -                if (pc1->lastmarker && state == pc1->lastmarker) {
> +            if (IS_MARKER(state)) {
> +                if (!pc1->lastmarker ||
> +                    CORE_MARKER(state) == pc1->lastmarker ||
> +                    pc1->lastmarker == DCA_SYNCWORD_SUBSTREAM) {

This would be more readable with pc1->lastmarker on the left side
on both lines.

> @@ -76,20 +84,20 @@ static int dca_find_frame_end(DCAParseContext
> *pc1, const uint8_t *buf,
>          for (; i < buf_size; i++) {
>              pc1->size++;
>              state = (state << 8) | buf[i];
> -            if (state == DCA_SYNCWORD_SUBSTREAM && !pc1->hd_pos)
> -                pc1->hd_pos = pc1->size;
> -            if (state == pc1->lastmarker && IS_MARKER(state, i, buf, 
> buf_size)) {
> +            if (IS_MARKER(state) &&
> +                (CORE_MARKER(state) == pc1->lastmarker ||
> +                 pc1->lastmarker == DCA_SYNCWORD_SUBSTREAM)) {

same

Other than that detail, probably OK.

Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to