Skip to content

Commit

Permalink
Document shine encoder, rename it to %shine and leave %mp3.fxp
Browse files Browse the repository at this point in the history
for backward compat.
  • Loading branch information
toots committed Jul 21, 2013
1 parent 50a336b commit 6c281a1
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
9 changes: 9 additions & 0 deletions doc/content/encoding_formats.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@ Examples:
Optionally, liquidsoap can insert a message within mp3 data. You can set its value using the @msg@ parameter.
Setting it to @""@ disables this feature. This is its default value.

h3. SHINE

Shine is the fixed-point mp3 encoder. It is useful on architectures without a FPU, such as ARM.
It is named @%shine@ or @%mp3.fxp@ and its parameters are:

%%
%shine(channels=2,samplerate=44100,bitrate=128)
%%

h4. WAV

%%
Expand Down
2 changes: 1 addition & 1 deletion src/encoder/encoder.ml
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ struct
}

let to_string m =
Printf.sprintf "%%mp3.fxp(channels=%d,samplerate=%d,bitrate=%d)"
Printf.sprintf "%%shine(channels=%d,samplerate=%d,bitrate=%d)"
m.channels
m.samplerate
m.bitrate
Expand Down
3 changes: 2 additions & 1 deletion src/lang/lang_lexer.mll
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ rule token = parse
| "%mp3.cbr" { MP3 }
| "%mp3.abr" { MP3_ABR }
| "%mp3.vbr" { MP3_VBR }
| "%mp3.fxp" { MP3_FXP }
| "%mp3.fxp" { SHINE }
| "%shine" { SHINE }
| "%aac+" { AACPLUS }
| "%aacplus" { AACPLUS }
| "%aac" { VOAACENC }
Expand Down
6 changes: 3 additions & 3 deletions src/lang/lang_parser.mly
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
%token <int option list> TIME
%token <int option list * int option list> INTERVAL
%token OGG FLAC OPUS VORBIS VORBIS_CBR VORBIS_ABR THEORA DIRAC SPEEX GSTREAMER
%token WAV FDKAAC VOAACENC AACPLUS MP3 MP3_VBR MP3_ABR MP3_FXP EXTERNAL
%token WAV FDKAAC VOAACENC AACPLUS MP3 MP3_VBR MP3_ABR SHINE EXTERNAL
%token EOF
%token BEGIN END GETS TILD QUESTION
%token <Doc.item * (string*string) list> DEF
Expand Down Expand Up @@ -284,7 +284,7 @@ expr:
| MP3 app_opt { mk_mp3_cbr $2 }
| MP3_VBR app_opt { mk_mp3_vbr $2 }
| MP3_ABR app_opt { mk_mp3_abr $2 }
| MP3_FXP app_opt { mk_shine $2 }
| SHINE app_opt { mk_shine $2 }
| AACPLUS app_opt { mk_aacplus $2 }
| VOAACENC app_opt { mk_voaacenc $2 }
| FDKAAC app_opt { mk_fdkaac $2 }
Expand Down Expand Up @@ -380,7 +380,7 @@ cexpr:
| MP3 app_opt { mk_mp3_cbr $2 }
| MP3_VBR app_opt { mk_mp3_vbr $2 }
| MP3_ABR app_opt { mk_mp3_abr $2 }
| MP3_FXP app_opt { mk_shine $2 }
| SHINE app_opt { mk_shine $2 }
| FLAC app_opt { mk_flac $2 }
| AACPLUS app_opt { mk_aacplus $2 }
| VOAACENC app_opt { mk_voaacenc $2 }
Expand Down
2 changes: 1 addition & 1 deletion src/lang/lang_pp.ml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ let get_encoder_format tokenizer lexbuf =
| Lang_parser.MP3 -> Lang_encoders.mk_mp3_cbr []
| Lang_parser.MP3_VBR -> Lang_encoders.mk_mp3_vbr []
| Lang_parser.MP3_ABR -> Lang_encoders.mk_mp3_vbr []
| Lang_parser.MP3_FXP -> Lang_encoders.mk_shine []
| Lang_parser.SHINE -> Lang_encoders.mk_shine []
| Lang_parser.AACPLUS -> Lang_encoders.mk_aacplus []
| Lang_parser.VOAACENC -> Lang_encoders.mk_voaacenc []
| Lang_parser.FDKAAC -> Lang_encoders.mk_fdkaac []
Expand Down

0 comments on commit 6c281a1

Please sign in to comment.