[Mplayer-cvslog] CVS: main/libmpcodecs ad_msgsm.c,NONE,1.1 Makefile,1.16,1.17 ad.c,1.1,1.2

Arpi of Ize arpi at mplayer.dev.hu
Mon Mar 25 23:26:01 CET 2002


Update of /cvsroot/mplayer/main/libmpcodecs
In directory mplayer:/var/tmp.root/cvs-serv10769

Modified Files:
	Makefile ad.c 
Added Files:
	ad_msgsm.c 
Log Message:
ad_msgsm added

--- NEW FILE ---
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

#include "config.h"
#include "ad_internal.h"

static ad_info_t info = 
{
	"native MSGSM audio decoder",
	"msgsm",
	AFM_GSM,
	"A'rpi",
	"XAnim",
	""
};

LIBAD_EXTERN(msgsm)

#include "xa/xa_gsm.h"

static int init(sh_audio_t *sh_audio)
{
  if(!sh_audio->wf) return 0;
  // MS-GSM audio codec:
  GSM_Init();
  sh_audio->channels=sh_audio->wf->nChannels;
  sh_audio->samplerate=sh_audio->wf->nSamplesPerSec;
  // decodes 65 byte -> 320 short
  // 1 sec: sh_audio->channels*sh_audio->samplerate  samples
  // 1 frame: 320 samples
  sh_audio->i_bps=65*(sh_audio->channels*sh_audio->samplerate)/320;  // 1:10
  return 1;
}

static int preinit(sh_audio_t *sh_audio)
{
  sh_audio->audio_out_minsize=4*320;
  return 1;
}

static void uninit(sh_audio_t *sh)
{
}

static int control(sh_audio_t *sh,int cmd,void* arg, ...)
{
  return CONTROL_UNKNOWN;
}

static int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int maxlen)
{
    unsigned char ibuf[65]; // 65 bytes / frame
    if(demux_read_data(sh_audio->ds,ibuf,65)!=65) return -1; // EOF
    XA_MSGSM_Decoder(ibuf,(unsigned short *) buf); // decodes 65 byte -> 320 short
    return 2*320;
}

Index: Makefile
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/Makefile,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- Makefile	25 Mar 2002 22:04:12 -0000	1.16
+++ Makefile	25 Mar 2002 22:25:58 -0000	1.17
@@ -3,7 +3,7 @@
 
 LIBNAME = libmpcodecs.a
 
-AUDIO_SRCS=dec_audio.c ad.c ad_a52.c ad_acm.c ad_alaw.c ad_dk3adpcm.c ad_dk4adpcm.c ad_dshow.c ad_dvdpcm.c ad_ffmpeg.c ad_hwac3.c ad_imaadpcm.c ad_mp3.c ad_msadpcm.c ad_pcm.c ad_roqaudio.c
+AUDIO_SRCS=dec_audio.c ad.c ad_a52.c ad_acm.c ad_alaw.c ad_dk3adpcm.c ad_dk4adpcm.c ad_dshow.c ad_dvdpcm.c ad_ffmpeg.c ad_hwac3.c ad_imaadpcm.c ad_mp3.c ad_msadpcm.c ad_pcm.c ad_roqaudio.c ad_msgsm.c
 VIDEO_SRCS=dec_video.c vd.c vd_null.c vd_cinepak.c vd_qtrpza.c vd_ffmpeg.c vd_dshow.c vd_vfw.c vd_odivx.c vd_divx4.c vd_raw.c vd_xanim.c vd_msvidc.c vd_fli.c vd_qtrle.c vd_qtsmc.c vd_roqvideo.c vd_cyuv.c vd_nuv.c vd_libmpeg2.c vd_msrle.c vd_huffyuv.c vd_zlib.c
 
 ifeq ($(PNG),yes)

Index: ad.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ad.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ad.c	25 Mar 2002 22:04:12 -0000	1.1
+++ ad.c	25 Mar 2002 22:25:58 -0000	1.2
@@ -30,6 +30,7 @@
 extern ad_functions_t mpcodecs_ad_roqaudio;
 extern ad_functions_t mpcodecs_ad_dshow;
 extern ad_functions_t mpcodecs_ad_acm;
+extern ad_functions_t mpcodecs_ad_msgsm;
 
 ad_functions_t* mpcodecs_ad_drivers[] =
 {
@@ -48,6 +49,7 @@
   &mpcodecs_ad_dk4adpcm,
   &mpcodecs_ad_dk3adpcm,
   &mpcodecs_ad_roqaudio,
+  &mpcodecs_ad_msgsm,
 #ifdef USE_WIN32DLL
 #ifdef USE_DIRECTSHOW
   &mpcodecs_ad_dshow,




More information about the MPlayer-cvslog mailing list