Ticket #2038: pcm_codec_tag.diff

File pcm_codec_tag.diff, 1.5 KB (added by rectalogic@…, 14 years ago)

lookup codec_tag in wav muxer if audio

  • configure

     
    70687068  # mpeg1video for vf_lavc, snow for vf_uspp / vf_mcdeint,
    70697069  libavencoders="$mplayer_encoders MPEG1VIDEO_ENCODER SNOW_ENCODER"
    70707070  # needed for codec id -> tag conversion
    7071   libavmuxers="AVI_MUXER"
     7071  libavmuxers="AVI_MUXER WAV_MUXER"
    70727072fi
    70737073echores "$_mencoder"
    70747074
  • libmpdemux/mp_taglists.c

     
    161161
    162162enum CodecID mp_tag2codec_id(uint32_t tag, int audio)
    163163{
    164     AVOutputFormat *avi_format;
     164    AVOutputFormat *av_format;
    165165    enum CodecID id = av_codec_get_id(audio ? mp_wav_taglists : mp_bmp_taglists, tag);
    166166    if (id != CODEC_ID_NONE)
    167167        return id;
    168     avi_format = av_guess_format("avi", NULL, NULL);
    169     if (!avi_format) {
    170         mp_msg(MSGT_DEMUXER, MSGL_FATAL, "MPlayer cannot work properly without AVI muxer in libavformat!\n");
     168    av_format = av_guess_format(audio ? "wav" : "avi", NULL, NULL);
     169    if (!av_format) {
     170        mp_msg(MSGT_DEMUXER, MSGL_FATAL, "MPlayer cannot work properly without %s muxer in libavformat!\n", audio ? "WAV" : "AVI");
    171171        return 0;
    172172    }
    173     return av_codec_get_id(avi_format->codec_tag, tag);
     173    return av_codec_get_id(av_format->codec_tag, tag);
    174174}
    175175
    176176uint32_t mp_codec_id2tag(enum CodecID codec_id, uint32_t old_tag, int audio)