Mercurial > mplayer.hg
changeset 7574:87f57e23e301
fixing RV10 streamcopy - detect packet format (simple single frame vs. slices
with extra header + offset tab) based on codec header instead of demuxer type
author | arpi |
---|---|
date | Tue, 01 Oct 2002 21:30:10 +0000 |
parents | 30e1c1f77737 |
children | 3a6d7933a6ad |
files | libmpcodecs/vd_ffmpeg.c |
diffstat | 1 files changed, 17 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/libmpcodecs/vd_ffmpeg.c Tue Oct 01 20:01:04 2002 +0000 +++ b/libmpcodecs/vd_ffmpeg.c Tue Oct 01 21:30:10 2002 +0000 @@ -200,19 +200,21 @@ #endif if( sh->format == mmioFOURCC('R', 'V', '1', '0') || sh->format == mmioFOURCC('R', 'V', '1', '3')){ - unsigned int* extrahdr=(unsigned int*)(sh->bih+1); avctx->extradata_size= 8; avctx->extradata = malloc(avctx->extradata_size); - if(sh->ds->demuxer->type != DEMUXER_TYPE_REAL){ - /* not .rm container -> only 1 packet per frame & sub_id from fourcc */ - if (sh->format == mmioFOURCC('R', 'V', '1', '3')) - extrahdr[1] = 0x10003001; - else - extrahdr[1] = 0x10000000; - } - ((uint32_t*)avctx->extradata)[0] = extrahdr[0]; - ((uint32_t*)avctx->extradata)[1] = extrahdr[1]; - avctx->sub_id= extrahdr[1]; + if(sh->bih->biSize!=sizeof(*sh->bih)+8){ + /* only 1 packet per frame & sub_id from fourcc */ + ((uint32_t*)avctx->extradata)[0] = 0; + avctx->sub_id= + ((uint32_t*)avctx->extradata)[1] = + (sh->format == mmioFOURCC('R', 'V', '1', '3')) ? 0x10003001 : 0x10000000; + } else { + /* has extra slice header (demux_rm or rm->avi streamcopy) */ + unsigned int* extrahdr=(unsigned int*)(sh->bih+1); + ((uint32_t*)avctx->extradata)[0] = extrahdr[0]; + avctx->sub_id= + ((uint32_t*)avctx->extradata)[1] = extrahdr[1]; + } // printf("%X %X %d %d\n", extrahdr[0], extrahdr[1]); } @@ -473,7 +475,10 @@ #endif #if LIBAVCODEC_BUILD >= 4630 - if(sh->ds->demuxer->type == DEMUXER_TYPE_REAL){ +// if(sh->ds->demuxer->type == DEMUXER_TYPE_REAL){ + if( sh->format == mmioFOURCC('R', 'V', '1', '0') + || sh->format == mmioFOURCC('R', 'V', '1', '3')) + if(sh->bih->biSize==sizeof(*sh->bih)+8){ int i; dp_hdr_t *hdr= (dp_hdr_t*)data;