@@ -57,7 +57,7 @@ func main() {
5757func listCodecs () {
5858 fmt .Println ("==================================================" )
5959 fmt .Println ("CODECS" )
60- fmt .Println ("==================================================\n " )
60+ fmt .Println ("==================================================" )
6161 fmt .Printf (" %s %-24s %-42s %s\n " , "DE" , "NAME" , "DESCRIPTION" , "TYPE" )
6262 fmt .Println ()
6363
@@ -198,7 +198,7 @@ func getCodecName(codecID ffmpeg.AVCodecID) string {
198198func listFormats () {
199199 fmt .Println ("\n ==================================================" )
200200 fmt .Println ("FORMATS" )
201- fmt .Println ("==================================================\n " )
201+ fmt .Println ("==================================================" )
202202 fmt .Printf ("%s %-24s %-42s %-35s %s\n " , "DE" , "NAME" , "DESCRIPTION" , "CODECS" , "MIME TYPE" )
203203 fmt .Println ()
204204
@@ -413,7 +413,7 @@ func listFormats() {
413413func listBSFs () {
414414 fmt .Println ("\n ==================================================" )
415415 fmt .Println ("BITSTREAM FILTERS" )
416- fmt .Println ("==================================================\n " )
416+ fmt .Println ("==================================================" )
417417 fmt .Printf (" %-24s %-42s\n " , "NAME" , "SUPPORTED CODECS" )
418418 fmt .Println ()
419419
@@ -429,11 +429,11 @@ func listBSFs() {
429429 count ++
430430
431431 // Get the bitstream filter name
432- name := bsf .Name ()
432+ nameStr := bsf .Name (). String ()
433433
434434 // Truncate name if too long
435- if len (name ) > 24 {
436- name = name [:24 ]
435+ if len (nameStr ) > 24 {
436+ nameStr = nameStr [:24 ]
437437 }
438438
439439 // Get supported codec IDs
@@ -443,11 +443,11 @@ func listBSFs() {
443443 codecSpecificCount ++
444444 var codecs []string
445445 for i := uintptr (0 ); ; i ++ {
446- codecID := ( * ffmpeg . AVCodecID )( unsafe . Pointer ( uintptr ( unsafe . Pointer ( codecIDs )) + i * unsafe . Sizeof ( * codecIDs )) )
447- if * codecID == ffmpeg .AVCodecIdNone {
446+ codecID := codecIDs . Get ( i )
447+ if codecID == ffmpeg .AVCodecIdNone {
448448 break
449449 }
450- codecName := getCodecName (* codecID )
450+ codecName := getCodecName (codecID )
451451 codecs = append (codecs , codecName )
452452 }
453453 if len (codecs ) > 0 {
@@ -458,7 +458,7 @@ func listBSFs() {
458458 }
459459 }
460460
461- fmt .Printf (" %-24s %-42s\n " , name , codecList )
461+ fmt .Printf (" %-24s %-42s\n " , nameStr , codecList )
462462 }
463463
464464 fmt .Printf ("\n Summary:\n " )
@@ -470,7 +470,7 @@ func listBSFs() {
470470func listParsers () {
471471 fmt .Println ("\n ==================================================" )
472472 fmt .Println ("PARSERS" )
473- fmt .Println ("==================================================\n " )
473+ fmt .Println ("==================================================" )
474474 fmt .Printf (" %-24s %-42s\n " , "NAME" , "SUPPORTED CODECS" )
475475 fmt .Println ()
476476
@@ -538,7 +538,7 @@ func listParsers() {
538538func listProtocols () {
539539 fmt .Println ("\n ==================================================" )
540540 fmt .Println ("PROTOCOLS" )
541- fmt .Println ("==================================================\n " )
541+ fmt .Println ("==================================================" )
542542 fmt .Printf ("%s %-24s\n " , "IO" , "NAME" )
543543 fmt .Println ()
544544
@@ -701,7 +701,7 @@ func getHWDeviceTypeFromCodec(codec *ffmpeg.AVCodec) ffmpeg.AVHWDeviceType {
701701func listHWAccels () {
702702 fmt .Println ("\n ==================================================" )
703703 fmt .Println ("HARDWARE ACCELERATORS" )
704- fmt .Println ("==================================================\n " )
704+ fmt .Println ("==================================================" )
705705
706706 // First list hardware device types
707707 fmt .Printf (" %-24s\n " , "NAME" )
@@ -749,7 +749,7 @@ func listHWAccels() {
749749 // Unified list of hardware acceleration (hwaccels + hardware codecs)
750750 fmt .Println ("\n ==================================================" )
751751 fmt .Println ("HARDWARE CODECS" )
752- fmt .Println ("==================================================\n " )
752+ fmt .Println ("==================================================" )
753753 fmt .Printf (" %s %-24s %-42s %s %s\n " , "DEH" , "NAME" , "DESCRIPTION" , "TYPE" , "PRESENT" )
754754 fmt .Println ()
755755
@@ -981,7 +981,7 @@ func listHWAccels() {
981981func listFilters () {
982982 fmt .Println ("\n ==================================================" )
983983 fmt .Println ("FILTERS" )
984- fmt .Println ("==================================================\n " )
984+ fmt .Println ("==================================================" )
985985 fmt .Printf (" %s %-24s %-42s %s\n " , "TSHM" , "NAME" , "DESCRIPTION" , "TYPE" )
986986 fmt .Println ()
987987
@@ -1556,7 +1556,7 @@ func buildBSFMap() map[ffmpeg.AVCodecID][]string {
15561556 break
15571557 }
15581558
1559- name := bsf .Name ()
1559+ name := bsf .Name (). String ()
15601560 codecIDs := bsf .CodecIds ()
15611561
15621562 if codecIDs == nil {
@@ -1565,11 +1565,11 @@ func buildBSFMap() map[ffmpeg.AVCodecID][]string {
15651565 } else {
15661566 // Codec-specific BSF
15671567 for i := uintptr (0 ); ; i ++ {
1568- codecID := ( * ffmpeg . AVCodecID )( unsafe . Pointer ( uintptr ( unsafe . Pointer ( codecIDs )) + i * unsafe . Sizeof ( * codecIDs )) )
1569- if * codecID == ffmpeg .AVCodecIdNone {
1568+ codecID := codecIDs . Get ( i )
1569+ if codecID == ffmpeg .AVCodecIdNone {
15701570 break
15711571 }
1572- bsfMap [* codecID ] = append (bsfMap [* codecID ], name )
1572+ bsfMap [codecID ] = append (bsfMap [codecID ], name )
15731573 }
15741574 }
15751575 }
0 commit comments