changeset 16211:391b89e20a56

100l: fix avi demuxing for ni and nini cases, allow forcing ni and nini demuxers
author rtognimp
date Sat, 13 Aug 2005 12:20:07 +0000
parents c0ad310e5196
children 8ee9633a5e0d
files libmpdemux/demux_avi.c
diffstat 1 files changed, 39 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_avi.c	Sat Aug 13 07:04:53 2005 +0000
+++ b/libmpdemux/demux_avi.c	Sat Aug 13 12:20:07 2005 +0000
@@ -17,6 +17,9 @@
 extern demuxer_t* init_avi_with_ogg(demuxer_t* demuxer);
 extern int demux_ogg_open(demuxer_t* demuxer);
 
+extern demuxer_desc_t demuxer_desc_avi_ni;
+extern demuxer_desc_t demuxer_desc_avi_nini;
+
 // PTS:  0=interleaved  1=BPS-based
 int pts_from_bps=1;
 
@@ -271,10 +274,12 @@
 	if(priv->idx_size>0){
 	    // has index
 	    demux->type=DEMUXER_TYPE_AVI_NI;
+	    demux->desc=&demuxer_desc_avi_ni;
 	    --priv->idx_pos; // hack
 	} else {
 	    // no index
 	    demux->type=DEMUXER_TYPE_AVI_NINI;
+	    demux->desc=&demuxer_desc_avi_nini;
 	    priv->idx_pos=demux->filepos; // hack
 	}
 	priv->idx_pos_v=priv->idx_pos_a=priv->idx_pos;
@@ -522,6 +527,7 @@
         if(force_ni || abs(a_pos-v_pos)>0x100000){  // distance > 1MB
           mp_msg(MSGT_DEMUX,MSGL_INFO,MSGTR_NI_Message,force_ni?MSGTR_NI_Forced:MSGTR_NI_Detected);
           demuxer->type=DEMUXER_TYPE_AVI_NI; // HACK!!!!
+          demuxer->desc=&demuxer_desc_avi_ni; // HACK!!!!
 	  pts_from_bps=1; // force BPS sync!
         }
       }
@@ -530,6 +536,7 @@
       if(force_ni){
           mp_msg(MSGT_DEMUX,MSGL_INFO,MSGTR_UsingNINI);
           demuxer->type=DEMUXER_TYPE_AVI_NINI; // HACK!!!!
+          demuxer->desc=&demuxer_desc_avi_nini; // HACK!!!!
 	  priv->idx_pos_a=
 	  priv->idx_pos_v=demuxer->movi_start;
 	  pts_from_bps=1; // force BPS sync!
@@ -926,3 +933,35 @@
   demux_seek_avi,
   demux_avi_control
 };
+
+demuxer_desc_t demuxer_desc_avi_ni = {
+  "AVI demuxer, non-interleaved",
+  "avini",
+  "AVI",
+  "Arpi?",
+  "AVI files, including non interleaved files",
+  DEMUXER_TYPE_AVI,
+  1, // safe autodetect
+  avi_check_file,
+  demux_avi_fill_buffer_ni,
+  demux_open_hack_avi,
+  demux_close_avi,
+  demux_seek_avi,
+  demux_avi_control
+};
+
+demuxer_desc_t demuxer_desc_avi_nini = {
+  "AVI demuxer, non-interleaved and no index",
+  "avinini",
+  "AVI",
+  "Arpi?",
+  "AVI files, including non interleaved files",
+  DEMUXER_TYPE_AVI,
+  1, // safe autodetect
+  avi_check_file,
+  demux_avi_fill_buffer_nini,
+  demux_open_hack_avi,
+  demux_close_avi,
+  demux_seek_avi,
+  demux_avi_control
+};