From 55dbd183e343178e705124add8a7a9579c8e2a35 Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 5 Mar 2011 12:24:33 +0000 Subject: ad_liba52: Fix -ac a52 with tags other than 0x2000 or dnet Audio with all codec tags other than 0x2000 was byte-swapped, while only "dnet" should be. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33028 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/ad_liba52.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libmpcodecs') diff --git a/libmpcodecs/ad_liba52.c b/libmpcodecs/ad_liba52.c index 45126a0786..dd277fd20a 100644 --- a/libmpcodecs/ad_liba52.c +++ b/libmpcodecs/ad_liba52.c @@ -81,11 +81,11 @@ while(1){ if(c<0) return -1; /* EOF*/ sh_audio->a_in_buffer[sh_audio->a_in_buffer_len++]=c; } - if(sh_audio->format!=0x2000) swab(sh_audio->a_in_buffer,sh_audio->a_in_buffer,8); + if(sh_audio->format==MKTAG('d','n','e','t')) swab(sh_audio->a_in_buffer,sh_audio->a_in_buffer,8); length = a52_syncinfo (sh_audio->a_in_buffer, &flags, &sample_rate, &bit_rate); if(length>=7 && length<=3840) break; /* we're done.*/ /* bad file => resync*/ - if(sh_audio->format!=0x2000) swab(sh_audio->a_in_buffer,sh_audio->a_in_buffer,8); + if(sh_audio->format==MKTAG('d','n','e','t')) swab(sh_audio->a_in_buffer,sh_audio->a_in_buffer,8); memmove(sh_audio->a_in_buffer,sh_audio->a_in_buffer+1,7); --sh_audio->a_in_buffer_len; } @@ -94,7 +94,7 @@ while(1){ sh_audio->i_bps=bit_rate/8; sh_audio->samplesize=sh_audio->sample_format==AF_FORMAT_FLOAT_NE ? 4 : 2; demux_read_data(sh_audio->ds,sh_audio->a_in_buffer+8,length-8); - if(sh_audio->format!=0x2000) + if(sh_audio->format==MKTAG('d','n','e','t')) swab(sh_audio->a_in_buffer+8,sh_audio->a_in_buffer+8,length-8); #ifdef CONFIG_LIBA52_INTERNAL -- cgit v1.2.3 From e43e0de9e629c780bfe14af50c4c48b220495de4 Mon Sep 17 00:00:00 2001 From: cehoyos Date: Sat, 12 Mar 2011 10:50:14 +0000 Subject: ad_pcm, codecs.conf: support 'lpcm' in mov and float in aiff Support 'lpcm' in mov files, has audible (clipping?) artefacts on some systems. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33075 b3059339-0415-0410-9bf9-f77b7e298cf2 Support 32bit big endian float pcm in aiff. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33076 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/ad_pcm.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libmpcodecs') diff --git a/libmpcodecs/ad_pcm.c b/libmpcodecs/ad_pcm.c index 29e78d69af..1920f396f4 100644 --- a/libmpcodecs/ad_pcm.c +++ b/libmpcodecs/ad_pcm.c @@ -86,10 +86,12 @@ static int init(sh_audio_t * sh_audio) sh_audio->sample_format = AF_FORMAT_S8; break; case 0x32336c66: // 'fl32', bigendian float32 + case 0x32334C46: // 'FL32', bigendian float32 in aiff sh_audio->sample_format = AF_FORMAT_FLOAT_BE; sh_audio->samplesize = 4; break; case 0x666c3332: // '23lf', little endian float32, MPlayer internal fourCC + case 0x6D63706C: // 'lpcm' sh_audio->sample_format = AF_FORMAT_FLOAT_LE; sh_audio->samplesize = 4; break; -- cgit v1.2.3 From 78bdc33b485a96e478aeeea1e9a41d235f241103 Mon Sep 17 00:00:00 2001 From: zuxy Date: Wed, 23 Mar 2011 14:52:13 +0000 Subject: vd_ffmpeg: require aligned stride in get_buffer() Change MP_IMGFLAG_ACCEPT_STRIDE to MP_IMGFLAG_ACCEPT_ALIGNED_STRIDE in get_buffer() as various FFmpeg assembly routines assume aligned input. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33097 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/vd_ffmpeg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libmpcodecs') diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c index 2424dda95b..4e3211c412 100644 --- a/libmpcodecs/vd_ffmpeg.c +++ b/libmpcodecs/vd_ffmpeg.c @@ -521,7 +521,7 @@ static int get_buffer(AVCodecContext *avctx, AVFrame *pic){ sh_video_t *sh = avctx->opaque; vd_ffmpeg_ctx *ctx = sh->context; mp_image_t *mpi=NULL; - int flags= MP_IMGFLAG_ACCEPT_STRIDE | MP_IMGFLAG_PREFER_ALIGNED_STRIDE; + int flags= MP_IMGFLAG_ACCEPT_ALIGNED_STRIDE | MP_IMGFLAG_PREFER_ALIGNED_STRIDE; int type= MP_IMGTYPE_IPB; int width= avctx->width; int height= avctx->height; -- cgit v1.2.3 From aeb6ac60aeada3510c475cf75555d559bf407872 Mon Sep 17 00:00:00 2001 From: reimar Date: Thu, 14 Apr 2011 20:41:50 +0000 Subject: ad_qtaudio: don't run win32 loader code when it's not used Do not try to set up the FS segment when using quicktime to decode, it makes no sense to do that. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33259 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/ad_qtaudio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libmpcodecs') diff --git a/libmpcodecs/ad_qtaudio.c b/libmpcodecs/ad_qtaudio.c index fd1ad2151a..b6c7ef6299 100644 --- a/libmpcodecs/ad_qtaudio.c +++ b/libmpcodecs/ad_qtaudio.c @@ -279,7 +279,7 @@ static void uninit(sh_audio_t *sh){ unsigned long ConvertedFrames=0; unsigned long ConvertedBytes=0; -#ifdef WIN32_LOADER +#if defined(WIN32_LOADER) && !defined(CONFIG_QUICKTIME) Setup_FS_Segment(); #endif @@ -306,7 +306,7 @@ static int decode_audio(sh_audio_t *sh,unsigned char *buf,int minlen,int maxlen) unsigned long ConvertedFrames=0; unsigned long ConvertedBytes=0; -#ifdef WIN32_LOADER +#if defined(WIN32_LOADER) && !defined(CONFIG_QUICKTIME) Setup_FS_Segment(); #endif -- cgit v1.2.3 From d09882bd74b4a406b4a1e66cf1761d4de67b066b Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 22 Apr 2011 07:58:06 +0000 Subject: vd_ffmpeg: handle reget_buffer in DRI failure fallback code Allow reget_buffer to somewhat work after direct rendering failure. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33286 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/vd_ffmpeg.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libmpcodecs') diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c index 4e3211c412..c7f0e429f1 100644 --- a/libmpcodecs/vd_ffmpeg.c +++ b/libmpcodecs/vd_ffmpeg.c @@ -559,6 +559,9 @@ static int get_buffer(AVCodecContext *avctx, AVFrame *pic){ if(init_vo(sh, avctx->pix_fmt) < 0){ avctx->release_buffer= avcodec_default_release_buffer; avctx->get_buffer= avcodec_default_get_buffer; + avctx->reget_buffer= avcodec_default_reget_buffer; + if (pic->data[0]) + release_buffer(avctx, pic); return avctx->get_buffer(avctx, pic); } @@ -571,6 +574,9 @@ static int get_buffer(AVCodecContext *avctx, AVFrame *pic){ ctx->do_dr1=0; //FIXME avctx->get_buffer= avcodec_default_get_buffer; + avctx->reget_buffer= avcodec_default_reget_buffer; + if (pic->data[0]) + release_buffer(avctx, pic); return avctx->get_buffer(avctx, pic); } -- cgit v1.2.3 From b977f5960937621f0276ec2d14b6288e95e35c3c Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 22 Apr 2011 08:05:56 +0000 Subject: vd_ffmpeg: Make DR work with reget_buffer without buffer_hints Allow DR to work with reget_buffer when no buffer_hints are set. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33287 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/vd_ffmpeg.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libmpcodecs') diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c index c7f0e429f1..a4683e4080 100644 --- a/libmpcodecs/vd_ffmpeg.c +++ b/libmpcodecs/vd_ffmpeg.c @@ -525,6 +525,9 @@ static int get_buffer(AVCodecContext *avctx, AVFrame *pic){ int type= MP_IMGTYPE_IPB; int width= avctx->width; int height= avctx->height; + // special case to handle reget_buffer without buffer hints + if (pic->opaque && pic->data[0] && !pic->buffer_hints) + return 0; avcodec_align_dimensions(avctx, &width, &height); //printf("get_buffer %d %d %d\n", pic->reference, ctx->ip_count, ctx->b_count); -- cgit v1.2.3 From 84b2296c343e0d3b9bc4fb1a71fd1ba6a9926400 Mon Sep 17 00:00:00 2001 From: reimar Date: Mon, 25 Apr 2011 09:48:11 +0000 Subject: ad_speex: support decoding stream without header packet Setup default speex modes, allows decoding of speex in flv which does not contain a header packet. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33327 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/ad_speex.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'libmpcodecs') diff --git a/libmpcodecs/ad_speex.c b/libmpcodecs/ad_speex.c index f8ddc2f336..c9ac1a42c6 100644 --- a/libmpcodecs/ad_speex.c +++ b/libmpcodecs/ad_speex.c @@ -63,11 +63,8 @@ static int init(sh_audio_t *sh) { const uint8_t *hdr = (const uint8_t *)(sh->wf + 1); const SpeexMode *spx_mode; const SpeexStereoState st_st = SPEEX_STEREO_STATE_INIT; // hack - if (!sh->wf || sh->wf->cbSize < 80) { - mp_msg(MSGT_DECAUDIO, MSGL_FATAL, "Missing extradata!\n"); - goto err_out; - } - ctx->hdr = speex_packet_to_header((char *)&sh->wf[1], sh->wf->cbSize); + if (sh->wf && sh->wf->cbSize >= 80) + ctx->hdr = speex_packet_to_header((char *)&sh->wf[1], sh->wf->cbSize); if (!ctx->hdr && sh->wf->cbSize == 0x72 && hdr[0] == 1 && hdr[1] == 0) { // speex.acm format: raw SpeexHeader dump ctx->hdr = calloc(1, sizeof(*ctx->hdr)); @@ -86,8 +83,18 @@ static int init(sh_audio_t *sh) { ctx->hdr->frames_per_packet = read_le32(&hdr); } if (!ctx->hdr) { - mp_msg(MSGT_DECAUDIO, MSGL_FATAL, "Invalid extradata!\n"); - goto err_out; + mp_msg(MSGT_DECAUDIO, MSGL_ERR, "Invalid or missing extradata! Assuming defaults.\n"); + ctx->hdr = calloc(1, sizeof(*ctx->hdr)); + ctx->hdr->frames_per_packet = 1; + ctx->hdr->mode = 0; + if (sh->wf) { + ctx->hdr->nb_channels = sh->wf->nChannels; + ctx->hdr->rate = sh->wf->nSamplesPerSec; + if (ctx->hdr->rate > 16000) + ctx->hdr->mode = 2; + else if (ctx->hdr->rate > 8000) + ctx->hdr->mode = 1; + } } if (ctx->hdr->nb_channels != 1 && ctx->hdr->nb_channels != 2) { mp_msg(MSGT_DECAUDIO, MSGL_WARN, "Invalid number of channels (%i), " @@ -119,12 +126,6 @@ static int init(sh_audio_t *sh) { sh->sample_format = AF_FORMAT_S16_NE; sh->context = ctx; return 1; - -err_out: - if (ctx) - free(ctx->hdr); - free(ctx); - return 0; } static void uninit(sh_audio_t *sh) { -- cgit v1.2.3