On 14/03/14 16:42, wm4 wrote:
> On Thu, 13 Mar 2014 22:35:41 +0100
> Luca Barbato <[email protected]> wrote:
> 
>> It should provide a quicker guess for elementary streams provided
>> by http.
> 
> 
>> @@ -212,6 +213,9 @@ AVInputFormat *av_probe_input_format2(AVProbeData *pd, 
>> int is_opened,
>>              if (av_match_ext(lpd.filename, fmt1->extensions))
>>                  score = AVPROBE_SCORE_EXTENSION;
>>          }
>> +        if (match_name(lpd.mime_type, fmt1->mime_type))
>> +            score = FFMAX(score, AVPROBE_SCORE_EXTENSION);
>> +
>>          if (score > *score_max) {
>>              *score_max = score;
>>              fmt        = fmt1;
> 
> Can you explain how exactly the mime type is used in the probing
> process? To me, it looks like it works equally to file extensions (and
> the score is raised to AVPROBE_SCORE_EXTENSION), but on IRC you said
> it's different.

The only part different is that match_ext works in a way slightly
different from match_name and that I added a field in the probe so third
parties (e.g. you if you decide to leverage curl for http in mpv) can
enjoy it as well.

As I said on irc, for the scoring purpose it is pretty much the same.

> Personally, I'd probably trust mime types much more than file
> extensions.

It is enough to trust it as a file extension, I could amend the patch to
have a + 1 over the SCORE_EXTENSION.

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

Reply via email to