[Ffmpeg-devel] [PATCH] DVR-MS probe audio format - was DVR-MS bug (MP2 decoding)

Michael Niedermayer michaelni
Wed Apr 11 00:13:51 CEST 2007


Hi

On Tue, Apr 10, 2007 at 04:42:25PM -0500, John Donaghy wrote:
[...]
> >+             }
> >>          }
> >>          if(st->parser && st->parser->parser->split &&
> >!st->codec->extradata){
> >>              int i= st->parser->parser->split(st->codec, pkt->data,
> >pkt->size);
> >> @@ -1866,12 +1895,27 @@
> >>                  }
> >>              }
> >>          }else if(st->codec->codec_type == CODEC_TYPE_AUDIO) {
> >> +            codec_identified[st->index] = set_codec_from_probe_data(st,
> >&(probe_data[st->index]), 0);
> >> +            if (codec_identified[st->index]) {
> >> +                st->need_parsing = 1;
> >> +            }
> >
> >a check for CODEC_ID_NONE seems missing here, this looks like it would
> >mess
> >with "normal" audio too
> 
> 
> You're right. See attached update.
[...]
> @@ -1787,6 +1807,13 @@
>              }
>              if(last == AV_NOPTS_VALUE || duration_count[index]<=1)
>                  last_dts[pkt->stream_index]= pkt->dts;
> +
> +            if (st->codec->codec_id == CODEC_ID_NONE) {
> +                AVProbeData *pd = &(probe_data[st->index]);
> +                pd->buf = av_realloc(pd->buf, pd->buf_size+pkt->size);
> +                memcpy(pd->buf+pd->buf_size, pkt->data, pkt->size);
> +                pd->buf_size += pkt->size;
> +             }

indention is off by 1 space


>          }
>          if(st->parser && st->parser->parser->split && !st->codec->extradata){
>              int i= st->parser->parser->split(st->codec, pkt->data, pkt->size);
> @@ -1865,13 +1892,29 @@
>                      st->r_frame_rate.den = st->time_base.num;
>                  }
>              }
> -        }else if(st->codec->codec_type == CODEC_TYPE_AUDIO) {
> +        }else if (st->codec->codec_type == CODEC_TYPE_AUDIO &&
> +                  st->codec->codec_id == CODEC_ID_NONE) {
> +            codec_identified[st->index] = set_codec_from_probe_data(st, &(probe_data[st->index]), 0);
> +            if (codec_identified[st->index]) {
> +                st->need_parsing = 1;
> +            }
>              if(!st->codec->bits_per_sample)
>                  st->codec->bits_per_sample= av_get_bits_per_sample(st->codec->codec_id);
>          }

breaks codec->bits_per_sample code 

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Opposition brings concord. Out of discord comes the fairest harmony.
-- Heraclitus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070411/4d9b95e5/attachment.pgp>



More information about the ffmpeg-devel mailing list