[MPlayer-cvslog] r37747 - in trunk: DOCS/man/cs/mplayer.1 DOCS/man/de/mplayer.1 DOCS/man/en/mplayer.1 DOCS/man/es/mplayer.1 DOCS/man/fr/mplayer.1 DOCS/man/hu/mplayer.1 DOCS/man/it/mplayer.1 DOCS/man/ru/mplayer.1 DO...

reimar subversion at mplayerhq.hu
Sat Feb 20 11:47:37 CET 2016


Author: reimar
Date: Sat Feb 20 11:47:37 2016
New Revision: 37747

Log:
stream_pvr: add AAC and AC-3 audio encoding control options

Use alayer=4 for AAC or alayer=5 for AC-3.

These are in fact the only two values supported by hdpvr.

Signed-off-by: Reza Arbab <arbab at panix.com>

Patch by Reza Arbab [arbab panix.com]

Modified:
   trunk/cfg-common.h
   trunk/stream/stream_pvr.c

Changes in other areas also in this revision:
Modified:
   trunk/DOCS/man/cs/mplayer.1
   trunk/DOCS/man/de/mplayer.1
   trunk/DOCS/man/en/mplayer.1
   trunk/DOCS/man/es/mplayer.1
   trunk/DOCS/man/fr/mplayer.1
   trunk/DOCS/man/hu/mplayer.1
   trunk/DOCS/man/it/mplayer.1
   trunk/DOCS/man/ru/mplayer.1
   trunk/DOCS/man/zh_CN/mplayer.1

Modified: trunk/cfg-common.h
==============================================================================
--- trunk/cfg-common.h	Sat Feb 20 11:47:34 2016	(r37746)
+++ trunk/cfg-common.h	Sat Feb 20 11:47:37 2016	(r37747)
@@ -141,7 +141,7 @@ const m_option_t tvopts_conf[]={
 const m_option_t pvropts_conf[]={
     {"aspect", &pvr_param_aspect_ratio, CONF_TYPE_INT, 0, 1, 4, NULL},
     {"arate", &pvr_param_sample_rate, CONF_TYPE_INT, 0, 32000, 48000, NULL},
-    {"alayer", &pvr_param_audio_layer, CONF_TYPE_INT, 0, 1, 2, NULL},
+    {"alayer", &pvr_param_audio_layer, CONF_TYPE_INT, 0, 1, 5, NULL},
     {"abitrate", &pvr_param_audio_bitrate, CONF_TYPE_INT, 0, 32, 448, NULL},
     {"amode", &pvr_param_audio_mode, CONF_TYPE_STRING, 0, 0, 0, NULL},
     {"vbitrate", &pvr_param_bitrate, CONF_TYPE_INT, 0, 0, 0, NULL},

Modified: trunk/stream/stream_pvr.c
==============================================================================
--- trunk/stream/stream_pvr.c	Sat Feb 20 11:47:34 2016	(r37746)
+++ trunk/stream/stream_pvr.c	Sat Feb 20 11:47:37 2016	(r37747)
@@ -811,6 +811,10 @@ parse_encoder_options (struct pvr_t *pvr
     pvr->layer = V4L2_MPEG_AUDIO_ENCODING_LAYER_2;
   else if (pvr_param_audio_layer == 3)
     pvr->layer = V4L2_MPEG_AUDIO_ENCODING_LAYER_3;
+  else if (pvr_param_audio_layer == 4)
+    pvr->layer = V4L2_MPEG_AUDIO_ENCODING_AAC;
+  else if (pvr_param_audio_layer == 5)
+    pvr->layer = V4L2_MPEG_AUDIO_ENCODING_AC3;
 
   /* -pvr abitrate=x */
   if (pvr_param_audio_bitrate != 0)
@@ -965,6 +969,75 @@ parse_encoder_options (struct pvr_t *pvr
         break;
       default:
         break;
+      }
+    }
+
+    else if (pvr->layer == V4L2_MPEG_AUDIO_ENCODING_AAC)
+      pvr->audio_rate = pvr_param_audio_bitrate;
+
+    else if (pvr->layer == V4L2_MPEG_AUDIO_ENCODING_AC3)
+    {
+      switch (pvr_param_audio_bitrate)
+      {
+      case 32:
+        pvr->audio_rate = V4L2_MPEG_AUDIO_AC3_BITRATE_32K;
+        break;
+      case 40:
+        pvr->audio_rate = V4L2_MPEG_AUDIO_AC3_BITRATE_40K;
+        break;
+      case 48:
+        pvr->audio_rate = V4L2_MPEG_AUDIO_AC3_BITRATE_48K;
+        break;
+      case 56:
+        pvr->audio_rate = V4L2_MPEG_AUDIO_AC3_BITRATE_56K;
+        break;
+      case 64:
+        pvr->audio_rate = V4L2_MPEG_AUDIO_AC3_BITRATE_64K;
+        break;
+      case 80:
+        pvr->audio_rate = V4L2_MPEG_AUDIO_AC3_BITRATE_80K;
+        break;
+      case 96:
+        pvr->audio_rate = V4L2_MPEG_AUDIO_AC3_BITRATE_96K;
+        break;
+      case 112:
+        pvr->audio_rate = V4L2_MPEG_AUDIO_AC3_BITRATE_112K;
+        break;
+      case 128:
+        pvr->audio_rate = V4L2_MPEG_AUDIO_AC3_BITRATE_128K;
+        break;
+      case 160:
+        pvr->audio_rate = V4L2_MPEG_AUDIO_AC3_BITRATE_160K;
+        break;
+      case 192:
+        pvr->audio_rate = V4L2_MPEG_AUDIO_AC3_BITRATE_192K;
+        break;
+      case 224:
+        pvr->audio_rate = V4L2_MPEG_AUDIO_AC3_BITRATE_224K;
+        break;
+      case 256:
+        pvr->audio_rate = V4L2_MPEG_AUDIO_AC3_BITRATE_256K;
+        break;
+      case 320:
+        pvr->audio_rate = V4L2_MPEG_AUDIO_AC3_BITRATE_320K;
+        break;
+      case 384:
+        pvr->audio_rate = V4L2_MPEG_AUDIO_AC3_BITRATE_384K;
+        break;
+      case 448:
+        pvr->audio_rate = V4L2_MPEG_AUDIO_AC3_BITRATE_448K;
+        break;
+      case 512:
+        pvr->audio_rate = V4L2_MPEG_AUDIO_AC3_BITRATE_512K;
+        break;
+      case 576:
+        pvr->audio_rate = V4L2_MPEG_AUDIO_AC3_BITRATE_576K;
+        break;
+      case 640:
+        pvr->audio_rate = V4L2_MPEG_AUDIO_AC3_BITRATE_640K;
+        break;
+      default:
+        break;
       }
     }
   }


More information about the MPlayer-cvslog mailing list