Skip to content

Commit

Permalink
Revert "encodingcom: remove dead code when creating a encoding.com Fo…
Browse files Browse the repository at this point in the history
…rmat"
  • Loading branch information
marzagao authored Dec 2, 2016
1 parent 731ca5a commit 4566b29
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion provider/encodingcom/encodingcom.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ func (e *encodingComProvider) sourceMedia(original string) string {
func (e *encodingComProvider) presetToFormat(preset db.Preset) encodingcom.Format {
falseYesNoBoolean := encodingcom.YesNoBoolean(false)
format := encodingcom.Format{
Output: []string{preset.Container},
Output: []string{preset.Container},
Destination: []string{"ftp://username:[email protected]/video/encoded/test.flv"},
}
if preset.Container == "m3u8" {
format.Output = []string{hlsOutput}
Expand Down
10 changes: 8 additions & 2 deletions provider/encodingcom/encodingcom_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,7 @@ func TestCreatePreset(t *testing.T) {
Gop: "cgop",
Keyframe: []string{"90"},
Size: "0x1080",
Destination: []string{"ftp://username:[email protected]/video/encoded/test.flv"},
}
if !reflect.DeepEqual(fakePreset.Request.Format[0], expectedFormat) {
pretty.Fdiff(os.Stderr, fakePreset.Request.Format[0], expectedFormat)
Expand Down Expand Up @@ -858,8 +859,9 @@ func TestCreatePresetHLS(t *testing.T) {
fakePreset := server.presets[presetName]
falseYesNoBoolean := encodingcom.YesNoBoolean(false)
expectedFormat := encodingcom.Format{
Output: []string{hlsOutput},
PackFiles: &falseYesNoBoolean,
Output: []string{hlsOutput},
Destination: []string{"ftp://username:[email protected]/video/encoded/test.flv"},
PackFiles: &falseYesNoBoolean,
Stream: []encodingcom.Stream{
{
AudioBitrate: "128k",
Expand Down Expand Up @@ -901,6 +903,7 @@ func TestPresetToFormat(t *testing.T) {
},
encodingcom.Format{
Output: []string{"advanced_hls"},
Destination: []string{"ftp://username:[email protected]/video/encoded/test.flv"},
VideoCodecParameters: encodingcom.VideoCodecParameters{},
Stream: []encodingcom.Stream{
{
Expand Down Expand Up @@ -928,6 +931,7 @@ func TestPresetToFormat(t *testing.T) {
},
encodingcom.Format{
Output: []string{"webm"},
Destination: []string{"ftp://username:[email protected]/video/encoded/test.flv"},
AudioCodec: "libvorbis",
AudioVolume: 100,
Gop: "cgop",
Expand All @@ -950,6 +954,7 @@ func TestPresetToFormat(t *testing.T) {
},
encodingcom.Format{
Output: []string{"webm"},
Destination: []string{"ftp://username:[email protected]/video/encoded/test.flv"},
AudioCodec: "libvorbis",
AudioVolume: 100,
Gop: "cgop",
Expand All @@ -974,6 +979,7 @@ func TestPresetToFormat(t *testing.T) {
},
encodingcom.Format{
Output: []string{"mp4"},
Destination: []string{"ftp://username:[email protected]/video/encoded/test.flv"},
AudioCodec: "dolby_aac",
AudioVolume: 100,
Gop: "cgop",
Expand Down

0 comments on commit 4566b29

Please sign in to comment.