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

Michael Niedermayer michaelni
Mon Apr 9 23:56:54 CEST 2007


Hi

On Mon, Apr 09, 2007 at 11:56:52AM -0500, John Donaghy wrote:
> >
> >you should call av_probe_input_format2()!
> >
> >OK, I've changed it to use av_probe_input_format2. Would you mind
> reviewing it now to see if the approach is along the right lines or not? I
> dont think it is quite there yet because there's probably a better way to
> write the set_codec_from_probe_data function - if you have any suggestions
> please let me know.

[...]
> @@ -1787,6 +1808,18 @@
>              }
>              if(last == AV_NOPTS_VALUE || duration_count[index]<=1)
>                  last_dts[pkt->stream_index]= pkt->dts;
> +
> +            if (st->codec->codec_type == CODEC_TYPE_AUDIO &&
> +                st->codec->codec_id == CODEC_ID_NONE) {
> +                int score;
> +                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 = pd->buf_size+pkt->size;
> +
> +                score = pd->buf_size < PROBE_BUF_MAX ? AVPROBE_SCORE_MAX/4 : 0;
> +                codec_identified[st->index] = set_codec_from_probe_data(st, pd, score);               
> +             }
>          }
>          if(st->parser && st->parser->parser->split && !st->codec->extradata){
>              int i= st->parser->parser->split(st->codec, pkt->data, pkt->size);
> @@ -1866,12 +1899,28 @@
>                  }
>              }

>          }else if(st->codec->codec_type == CODEC_TYPE_AUDIO) {
> +            if (!codec_identified[st->index])
> +                codec_identified[st->index] = set_codec_from_probe_data(st, &(probe_data[st->index]), 0);
> +            if (codec_identified[st->index]) {
> +                st->need_parsing = 1;
> +            }

why is the code run twice?

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

The educated differ from the uneducated as much as the living from the
dead. -- Aristotle 
-------------- 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/20070409/c250a24b/attachment.pgp>



More information about the ffmpeg-devel mailing list