Changeset 786


Ignore:
Timestamp:
Oct 21, 2006 9:23:37 AM (18 years ago)
Author:
bennylp
Message:

Fixed quality setting in MP3 writer (thanks Toni again)

Location:
pjproject/trunk/pjmedia
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/include/pjmedia/mp3_port.h

    r785 r786  
    6666    pj_bool_t   vbr; 
    6767 
    68     /** Target bitrate, in bps. For VBR, if the bitrate is specified, then  
    69      *  the encoder will ignore the quality settings and instead will try to  
    70      *  limit the bitrate to the desired value in this setting. 
     68    /** Target bitrate, in bps. If VBR is enabled, this settings specifies  
     69     *  the  average bit-rate requested, and will make the encoder ignore  
     70     *  the quality setting. For CBR, this specifies the actual bitrate, 
     71     *  and if this option is zero, it will be set to the sampling rate 
     72     *  multiplied by number of channels. 
    7173     */ 
    7274    unsigned    bit_rate; 
  • pjproject/trunk/pjmedia/src/pjmedia/mp3_writer.c

    r785 r786  
    201201        LConfig.format.LHV1.bWriteVBRHeader = 1; 
    202202        LConfig.format.LHV1.dwVbrAbr_bps = fport->mp3_option.bit_rate; 
     203        LConfig.format.LHV1.nVBRQuality =  (pj_uint16_t) 
     204                                           fport->mp3_option.quality; 
    203205        LConfig.format.LHV1.bEnableVBR = 1; 
    204206    } 
    205207 
    206     LConfig.format.LHV1.nQuality =  (pj_uint16_t)fport->mp3_option.quality; 
     208    LConfig.format.LHV1.nQuality = (pj_uint16_t)  
     209                                   (((0-fport->mp3_option.quality-1)<<8) |  
     210                                    fport->mp3_option.quality); 
    207211 
    208212    /* 
Note: See TracChangeset for help on using the changeset viewer.