summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2008-10-02 05:17:23 +0300
committerUoti Urpala <uau@glyph.nonexistent.invalid>2008-10-02 05:17:23 +0300
commitebb4abf2081026c63bb5c983f76447d9d2413656 (patch)
treef2b3ed868645fd2546173be3500f4c3e0cdf3ecc
parent849dc0ba31f209dfdb48146512e48ee2203d0ee6 (diff)
parent20571d6f6870dab84624cc6b6fbac82cde204f16 (diff)
downloadmpv-ebb4abf2081026c63bb5c983f76447d9d2413656.tar.bz2
mpv-ebb4abf2081026c63bb5c983f76447d9d2413656.tar.xz
Merge svn changes up to r27682
Addition of the "outdir" suboption to vo_png in svn was reverted before merging. Conflicts: command.c mplayer.c
-rw-r--r--DOCS/man/en/mplayer.116
-rw-r--r--DOCS/man/fr/mplayer.180
-rw-r--r--DOCS/tech/slave.txt6
-rw-r--r--DOCS/xml/en/install.xml14
-rw-r--r--Makefile3
-rw-r--r--TOOLS/asfinfo.c316
-rw-r--r--command.c29
-rwxr-xr-xconfigure2
-rw-r--r--etc/codecs.conf10
-rw-r--r--input/input.c3
-rw-r--r--libmpdemux/demux_asf.c1
-rw-r--r--libmpdemux/demux_real.c3
-rw-r--r--libmpeg2/libmpeg2_changes.diff88
-rw-r--r--libmpeg2/motion_comp.c5
-rw-r--r--libmpeg2/motion_comp_iwmmxt.c59
-rw-r--r--libmpeg2/mpeg2.h1
-rw-r--r--libmpeg2/mpeg2_internal.h1
-rw-r--r--libswscale/swscale-example.c17
-rw-r--r--libswscale/swscale.c2
-rw-r--r--libvo/gl_common.c24
-rw-r--r--libvo/gl_common.h2
-rw-r--r--libvo/vo_gl.c16
-rw-r--r--libvo/vo_gl2.c6
-rw-r--r--m_property.c15
-rw-r--r--m_property.h3
-rw-r--r--mplayer.c10
-rw-r--r--stream/tvi_dshow.c13
-rw-r--r--vidix/ivtv_vid.c6
-rw-r--r--vidix/pm2_vid.c2
29 files changed, 365 insertions, 388 deletions
diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1
index 972e3bbc90..a169cbe613 100644
--- a/DOCS/man/en/mplayer.1
+++ b/DOCS/man/en/mplayer.1
@@ -4480,10 +4480,10 @@ If <w> is specified lowres decoding will be used only if the width of the
video is major than or equal to <w>.
.RE
.B o=<key>=<value>[,<key>=<value>[,...]]
-Pass AVOptions to libavcodec decoder
+Pass AVOptions to libavcodec decoder.
Note, a patch to make the o= unneeded and pass all unknown options through
the AVOption system is welcome.
-A full list of AVOptions can be found in FFmpeg manual.
+A full list of AVOptions can be found in the FFmpeg manual.
Note that some options may conflict with MEncoder options.
.sp 1
.RS
@@ -7645,10 +7645,10 @@ Read the source for full details.
.
.TP
.B o=<key>=<value>[,<key>=<value>[,...]]
-Pass AVOptions to libavcodec encoder
+Pass AVOptions to libavcodec encoder.
Note, a patch to make the o= unneeded and pass all unknown options through
the AVOption system is welcome.
-A full list of AVOptions can be found in FFmpeg manual.
+A full list of AVOptions can be found in the FFmpeg manual.
Note that some AVOptions may conflict with MEncoder options.
.sp 1
.RS
@@ -10488,10 +10488,10 @@ Force a specific libavformat demuxer.
.
.TP
.B o=<key>=<value>[,<key>=<value>[,...]]
-Pass AVOptions to libavformat demuxer
+Pass AVOptions to libavformat demuxer.
Note, a patch to make the o= unneeded and pass all unknown options through
the AVOption system is welcome.
-A full list of AVOptions can be found in FFmpeg manual.
+A full list of AVOptions can be found in the FFmpeg manual.
Note that some options may conflict with MPlayer/MEncoder options.
.sp 1
.RS
@@ -10571,10 +10571,10 @@ Sometimes raising it is necessary in order to avoid "buffer underflows".
.
.TP
.B o=<key>=<value>[,<key>=<value>[,...]]
-Pass AVOptions to libavformat muxer
+Pass AVOptions to libavformat muxer.
Note, a patch to make the o= unneeded and pass all unknown options through
the AVOption system is welcome.
-A full list of AVOptions can be found in FFmpeg manual.
+A full list of AVOptions can be found in the FFmpeg manual.
Note that some options may conflict with MEncoder options.
.sp 1
.RS
diff --git a/DOCS/man/fr/mplayer.1 b/DOCS/man/fr/mplayer.1
index e5d3487023..eacff95201 100644
--- a/DOCS/man/fr/mplayer.1
+++ b/DOCS/man/fr/mplayer.1
@@ -1,4 +1,4 @@
-.\" synced with r27466
+.\" synced with r27651
.\" Encoding: iso-8859-1
.\" MPlayer (C) 2000-2008 MPlayer Team
.\" The English man page was/is done by Gabucino, Diego Biurrun, Jonas Jermann
@@ -947,7 +947,7 @@ donc de votre responsablité qu'elle ne pose pas de problème de sécurité
le chemin de recherche $PATH, comme c'est le cas sous Windows).
.sp 1
Ceci peut être "détourné" pour désactiver un économiseur d'écran ne gérant par
-l'API de X prévu à cet effet.
+l'API de X prévu à cet effet (voir aussi \-stop\-xscreensaver).
Si cela vous semble un peu trop compliqué, demandez à l'auteur du programme
d'économiseur d'écran de gérer l'API de X dédiée.
.sp 1
@@ -3396,6 +3396,8 @@ fbdev, x11 et TVout
.B \-stop\-xscreensaver (X11 uniquement)
Désactive xscreensaver (le reposeur d'écran) au lancement et le réactive
à la sortie.
+Si votre reposeur d'écran ne supporte ni l'API XSS, ni XResetScreenSaver,
+alors veuillez utiliser \-heartbeat\-cmd à la place.
.
.TP
.B "\-vm \ \ \ "
@@ -4722,8 +4724,24 @@ réduite.
Si <l> est défini, le décodage en résolution réduite sera effectué uniquement
si la largeur de la vidéo est plus grande ou égale à <l>.
.RE
-.IPs "o\ \ \ \ "
-FIXME: non documenté
+.B o=<clef>=<valeur>[,<clef>=<valeur>[,...]]
+Passe des AVOptions au décodeur libavcodec.
+Notez que la création d'une rustine pour que cette option ne soit pas
+nécessaire, mais qu'à la place, toutes les options inconnues soient passées
+au système AVOption est la bienvenue.
+Une liste complète des AVOptions est disponible dans la documentation de
+FFmpeg.
+De plus, notez que certaines options peuvent entrer en conflit avec les
+options de MEncoder.
+.sp 1
+.RS
+.I EXEMPLE\ :
+.RE
+.RSs
+.PD 0
+.IPs o=debug=pict
+.PD 1
+.RE
.IPs "sb=<valeur> (MPEG-2 uniquement)"
Saute <valeur> lignes de macro-blocs au bas de l'image.
.IPs "st=<valeur> (MPEG-2 uniquement)"
@@ -8045,11 +8063,15 @@ Pour avoir tous les détails lisez le source.
.PD 1
.
.TP
-.B o=<key>=<value>[,<key>=<value>[,...]]
-Passe les à libavcodec les AVOptions.
+.B o=<clef>=<valeur>[,<clef>=<valeur>[,...]]
+Passe les AVOptions à l'encodeur libavcodec.
Notez que la création d'une rustine pour que cette option ne soit pas
nécessaire, mais qu'à la place, toutes les options inconnues soient passées
au système AVOption est la bienvenue.
+Une liste complète des AVOptions est disponible dans la documentation de
+FFmpeg.
+De plus, notez que certaines options peuvent entrer en conflit avec les
+options de MEncoder.
.sp 1
.RS
.I EXEMPLE\ :
@@ -9559,10 +9581,6 @@ FIXME: Document this.
.B skip_threshold=<0\-1000000>
FIXME: Document this.
.
-.TP
-.B "o\ \ \ \ \ \ "
-FIXME: non documenté
-.
.
.SS nuv (\-nuvopts)
.
@@ -11066,8 +11084,24 @@ Durée maximale (en secondes) pour analyser les propriétés du flux.
Force l'utilisation d'un dé-multiplexeur libavformat spécifique.
.
.TP
-.B "o\ \ \ \ \ \ "
-FIXME: non documenté
+.B o=<clef>=<valeur>[,<clef>=<valeur>[,...]]
+Passe les AVOptions au démultiplexeur libavformat.
+Notez que la création d'une rustine pour que cette option ne soit pas
+nécessaire, mais qu'à la place, toutes les options inconnues soient passées
+au système AVOption est la bienvenue.
+Une liste complète des AVOptions est disponible dans la documentation de
+FFmpeg.
+De plus, notez que certaines options peuvent entrer en conflit avec les
+options de MPlayer/MEncoder.
+.sp 1
+.RS
+.I EXEMPLE\ :
+.RE
+.RSs
+.PD 0
+.IPs o=ignidx
+.PD 1
+.RE
.
.TP
.B probesize=<valeur>
@@ -11117,6 +11151,8 @@ format MPEG-4 avec les drapeaux supplémentaires requis par les micrologiciels
(firmware) des iPods d'Apple
.IPs "dv\ \ \ "
Sony Digital Video container
+.IPs "matroska\ \ \ "
+Matroska
.RE
.PD 1
.
@@ -11128,8 +11164,24 @@ Il arrive qu'il faille augmenter ce paramètre pour éviter des débordements
de tampons "buffer underflows".
.
.TP
-.B "o\ \ \ \ \ \ "
-FIXME: non documenté
+.B o=<clef>=<valeur>[,<clef>=<valeur>[,...]]
+Passe les AVOptions au multiplexeur libavformat.
+Notez que la création d'une rustine pour que cette option ne soit pas
+nécessaire, mais qu'à la place, toutes les options inconnues soient passées
+au système AVOption est la bienvenue.
+Une liste complète des AVOptions est disponible dans la documentation de
+FFmpeg.
+De plus, notez que certaines options peuvent entrer en conflit avec les
+options de MEncoder.
+.sp 1
+.RS
+.I EXEMPLE\ :
+.RE
+.RSs
+.PD 0
+.IPs o=packetsize=100
+.PD 1
+.RE
.
.TP
.B packetsize=<taille>
diff --git a/DOCS/tech/slave.txt b/DOCS/tech/slave.txt
index 051920b89c..fe68dccda9 100644
--- a/DOCS/tech/slave.txt
+++ b/DOCS/tech/slave.txt
@@ -26,6 +26,10 @@ after processing the command. "pausing_keep " tells MPlayer to do so only if
it was already in paused mode. "pausing_toggle " tells MPlayer to do so
only if it was not already in paused mode. Please note that "as soon as
possible" can be before the command is fully executed.
+As a temporary hack, there is also the _experimental_ "pausing_keep_force "
+prefix, with which MPlayer will not exit the pause loop at all.
+Like this you can avoid the "frame stepping" effect of "pausing_keep "
+but most commands will either not work at all or behave in unexpected ways.
Available commands ('mplayer -input cmdlist' will print a list):
@@ -466,6 +470,7 @@ name type min max get set step comment
osdlevel int 0 3 X X X as -osdlevel
speed float 0.01 100 X X X as -speed
loop int -1 X X X as -loop
+pause flag 0 1 X 1 if paused, use with pausing_keep_force
filename string X file playing wo path
path string X file playing
demuxer string X demuxer used
@@ -474,6 +479,7 @@ stream_start pos 0 X start pos in stream
stream_end pos 0 X end pos in stream
stream_length pos 0 X (end - start)
chapter int 0 X X X select chapter
+chapters int X number of chapters
angle int 0 X X X select angle
length time X length of file in seconds
percent_pos int 0 100 X X X position in percent
diff --git a/DOCS/xml/en/install.xml b/DOCS/xml/en/install.xml
index 6821df7e0d..7503bffc43 100644
--- a/DOCS/xml/en/install.xml
+++ b/DOCS/xml/en/install.xml
@@ -177,11 +177,9 @@ See the <link linkend="subosd">Subtitles and OSD</link> section for details.
<title>What about the GUI?</title>
<para>
-The GUI needs GTK 1.2.x or GTK 2.0 (it isn't fully GTK, but the panels are).
-The skins are stored in PNG format, so GTK,
-<systemitem class="library">libpng</systemitem> (and their devel stuff, usually
-called <systemitem class="library">gtk-dev</systemitem>
-and <systemitem class="library">libpng-dev</systemitem>) has to be installed.
+The GUI needs GTK 1.2.x or GTK 2.0 (it isn't fully GTK, but the panels are),
+so <systemitem class="library">GTK</systemitem> (and the devel stuff, usually
+called <systemitem class="library">gtk-dev</systemitem>) has to be installed.
You can build it by specifying <option>--enable-gui</option> during
<filename>./configure</filename>. Then, to turn on GUI mode, you have to
execute the <command>gmplayer</command> binary.
@@ -189,16 +187,16 @@ execute the <command>gmplayer</command> binary.
<para>
As <application>MPlayer</application> doesn't have a skin included, you
-have to download them if you want to use the GUI. See the <ulink
+have to download one if you want to use the GUI. See the <ulink
url="http://www.mplayerhq.hu/dload.html">download page</ulink>.
-They should be extracted to the usual system-wide directory (<filename
+It should be extracted to the usual system-wide directory (<filename
class="directory">$PREFIX/share/mplayer/skins</filename>), or to <filename
class="directory">$HOME/.mplayer/skins</filename>.
<application>MPlayer</application> by default looks in these directories
for a directory named <filename class="directory">default</filename>, but
you can use the <option>-skin <replaceable>newskin</replaceable></option>
option, or the <literal>skin=newskin</literal> config file directive to use
-the skin in <filename class="directory">*/skins/newskin</filename>
+the skin in the <filename class="directory">*/skins/newskin</filename>
directory.
</para>
</sect1>
diff --git a/Makefile b/Makefile
index 9c889533af..4a0d521c9e 100644
--- a/Makefile
+++ b/Makefile
@@ -357,8 +357,7 @@ SRCS_COMMON-$(LIBMPEG2) += libmpcodecs/vd_libmpeg2.c \
SRCS_COMMON-$(LIBMPEG2)-$(ARCH_ALPHA) += libmpeg2/idct_alpha.c \
libmpeg2/motion_comp_alpha.c
SRCS_COMMON-$(LIBMPEG2)-$(ARCH_ARMV4L) += libmpeg2/motion_comp_arm.c \
- libmpeg2/motion_comp_arm_s.S \
- libmpeg2/motion_comp_iwmmxt.c
+ libmpeg2/motion_comp_arm_s.S
SRCS_COMMON-$(LIBMPEG2)-$(HAVE_ALTIVEC) += libmpeg2/idct_altivec.c \
libmpeg2/motion_comp_altivec.c
SRCS_COMMON-$(LIBMPEG2)-$(HAVE_MMX) += libmpeg2/idct_mmx.c \
diff --git a/TOOLS/asfinfo.c b/TOOLS/asfinfo.c
index b226dba906..fc5c76cc79 100644
--- a/TOOLS/asfinfo.c
+++ b/TOOLS/asfinfo.c
@@ -6,46 +6,46 @@
#include <stdio.h>
#include <stdlib.h>
-typedef struct __attribute__((packed))
+typedef struct __attribute__((packed))
{
- long biSize; // sizeof(BITMAPINFOHEADER)
- long biWidth;
- long biHeight;
- short biPlanes; // unused
- short biBitCount;
- long biCompression; // fourcc of image
- long biSizeImage; // size of image. For uncompressed images
- // ( biCompression 0 or 3 ) can be zero.
-
-
- long biXPelsPerMeter; // unused
- long biYPelsPerMeter; // unused
- long biClrUsed; // valid only for palettized images.
- // Number of colors in palette.
- long biClrImportant;
+ long biSize; // sizeof(BITMAPINFOHEADER)
+ long biWidth;
+ long biHeight;
+ short biPlanes; // unused
+ short biBitCount;
+ long biCompression; // fourcc of image
+ long biSizeImage; // size of image. For uncompressed images
+ // ( biCompression 0 or 3 ) can be zero.
+
+
+ long biXPelsPerMeter; // unused
+ long biYPelsPerMeter; // unused
+ long biClrUsed; // valid only for palettized images.
+ // Number of colors in palette.
+ long biClrImportant;
} BITMAPINFOHEADER;
typedef struct
{
- short wFormatTag; // value that identifies compression format
- short nChannels;
- long nSamplesPerSec;
- long nAvgBytesPerSec;
- short nBlockAlign; // size of a data sample
- short wBitsPerSample;
- short cbSize; // size of format-specific data
+ short wFormatTag; // value that identifies compression format
+ short nChannels;
+ long nSamplesPerSec;
+ long nAvgBytesPerSec;
+ short nBlockAlign; // size of a data sample
+ short wBitsPerSample;
+ short cbSize; // size of format-specific data
} WAVEFORMATEX;
typedef struct __attribute__((packed)) {
- unsigned char guid[16];
+ unsigned char guid[16];
unsigned long long size;
} ASF_obj_header_t;
typedef struct __attribute__((packed)) {
ASF_obj_header_t objh;
- unsigned int cno; // number of subchunks
- unsigned char v1; // unknown (0x01)
- unsigned char v2; // unknown (0x02)
+ unsigned int cno; // number of subchunks
+ unsigned char v1; // unknown (0x01)
+ unsigned char v2; // unknown (0x02)
} ASF_header_t;
typedef struct __attribute__((packed)) {
@@ -106,150 +106,168 @@ static char* chunk_type(unsigned char* guid){
}
static void print_wave_header(WAVEFORMATEX *h){
-
printf("======= WAVE Format =======\n");
-
- printf("Format Tag: %d (0x%X)\n",h->wFormatTag,h->wFormatTag);
- printf("Channels: %d\n",h->nChannels);
- printf("Samplerate: %ld\n",h->nSamplesPerSec);
- printf("avg byte/sec: %ld\n",h->nAvgBytesPerSec);
- printf("Block align: %d\n",h->nBlockAlign);
- printf("bits/sample: %d\n",h->wBitsPerSample);
- printf("cbSize: %d\n",h->cbSize);
-
+
+ printf("Format Tag: %d (0x%X)\n", h->wFormatTag, h->wFormatTag);
+ printf("Channels: %d\n", h->nChannels);
+ printf("Samplerate: %ld\n", h->nSamplesPerSec);
+ printf("avg byte/sec: %ld\n", h->nAvgBytesPerSec);
+ printf("Block align: %d\n", h->nBlockAlign);
+ printf("bits/sample: %d\n", h->wBitsPerSample);
+ printf("cbSize: %d\n", h->cbSize);
+
switch(h->wFormatTag){
- case 0x01: printf("Audio in PCM format\n");break;
- case 0x50: printf("Audio in MPEG Layer 1/2 format\n");break;
- case 0x55: printf("Audio in MPEG Layer-3 format\n");break; // ACM
- case 0x02: printf("Audio in MS ADPCM format\n");break; // ACM
- case 0x11: printf("Audio in IMA ADPCM format\n");break; // ACM
- case 0x31:
- case 0x32: printf("Audio in MS GSM 6.10 format\n");break; // ACM
- case 0x160:
- case 0x161: printf("Audio in DivX WMA format\n");break; // ACM
- default: printf("Audio in UNKNOWN (id=0x%X) format\n",h->wFormatTag);
+ case 0x01: printf("Audio in PCM format\n"); break;
+ case 0x50: printf("Audio in MPEG Layer 1/2 format\n"); break;
+ case 0x55: printf("Audio in MPEG Layer-3 format\n"); break; // ACM
+ case 0x02: printf("Audio in MS ADPCM format\n"); break; // ACM
+ case 0x11: printf("Audio in IMA ADPCM format\n"); break; // ACM
+ case 0x31:
+ case 0x32: printf("Audio in MS GSM 6.10 format\n"); break; // ACM
+ case 0x160:
+ case 0x161: printf("Audio in DivX WMA format\n"); break; // ACM
+ default: printf("Audio in UNKNOWN (id=0x%X) format\n", h->wFormatTag);
}
printf("===========================\n");
-
-
}
static void print_video_header(BITMAPINFOHEADER *h){
printf("======= VIDEO Format ======\n");
- printf(" biSize %ld\n", h->biSize);
- printf(" biWidth %ld\n", h->biWidth);
- printf(" biHeight %ld\n", h->biHeight);
- printf(" biPlanes %d\n", h->biPlanes);
- printf(" biBitCount %d\n", h->biBitCount);
- printf(" biCompression %ld='%.4s'\n", h->biCompression, &h->biCompression);
- printf(" biSizeImage %ld\n", h->biSizeImage);
+ printf(" biSize %ld\n", h->biSize);
+ printf(" biWidth %ld\n", h->biWidth);
+ printf(" biHeight %ld\n", h->biHeight);
+ printf(" biPlanes %d\n", h->biPlanes);
+ printf(" biBitCount %d\n", h->biBitCount);
+ printf(" biCompression %ld='%.4s'\n", h->biCompression, &h->biCompression);
+ printf(" biSizeImage %ld\n", h->biSizeImage);
printf("===========================\n");
}
FILE* streams[128];
-int main(int argc,char* argv[]){
-FILE *f=fopen(argc>1?argv[1]:"Alice Deejay - Back In My Life.asf","rb");
-
-if(!f){ printf("file not found\n");exit(1);}
-
-//printf("sizeof=%d\n",sizeof(objh));
-//printf("sizeof=%d\n",sizeof(asfh));
-
-fread(&asfh,sizeof(asfh),1,f); // header obj
-//for(i=0;i<16;i++) printf("%02X ",asfh.objh.guid[i]);
-printf("[%s] %d (subchunks: %d)\n",chunk_type(asfh.objh.guid),(int) asfh.objh.size,asfh.cno);
-
-while(fread(&objh,sizeof(objh),1,f)>0){
- int pos=ftell(f);
-// for(i=0;i<16;i++) printf("%02X ",objh.guid[i]);
- printf("0x%08X [%s] %d\n",pos-sizeof(objh), chunk_type(objh.guid),(int) objh.size);
- switch(*((unsigned int*)&objh.guid)){
- case 0xB7DC0791: // guid_stream_header
- fread(&streamh,sizeof(streamh),1,f);
- printf("stream type: %s\n",chunk_type(streamh.type));
- printf("stream concealment: %s\n",chunk_type(streamh.concealment));
- printf("type: %d bytes, stream: %d bytes ID: %d\n",(int)streamh.type_size,(int)streamh.stream_size,(int)streamh.stream_no);
- printf("FILEPOS=0x%lX\n",ftell(f));
- // type-specific data:
- fread(buffer,streamh.type_size,1,f);
- switch(*((unsigned int*)&streamh.type)){
- case 0xF8699E40: // guid_audio_stream
- print_wave_header((WAVEFORMATEX*)buffer);
+int main(int argc, char* argv[]){
+ FILE *f = fopen(argc > 1 ? argv[1] : "Alice Deejay - Back In My Life.asf", "rb");
+
+ if(!f){
+ printf("file not found\n");
+ exit(1);
+ }
+
+ //printf("sizeof=%d\n", sizeof(objh));
+ //printf("sizeof=%d\n", sizeof(asfh));
+
+ fread(&asfh, sizeof(asfh), 1, f); // header obj
+ //for(i = 0; i < 16; i++)
+ // printf("%02X ", asfh.objh.guid[i]);
+ printf("[%s] %d (subchunks: %d)\n", chunk_type(asfh.objh.guid),
+ (int) asfh.objh.size, asfh.cno);
+
+ while(fread(&objh, sizeof(objh), 1, f) > 0){
+ int pos = ftell(f);
+ //for(i = 0; i < 16; i++)
+ // printf("%02X ", objh.guid[i]);
+ printf("0x%08X [%s] %d\n", pos-sizeof(objh), chunk_type(objh.guid),
+ (int) objh.size);
+ switch(*((unsigned int*)&objh.guid)){
+ case 0xB7DC0791: // guid_stream_header
+ fread(&streamh, sizeof(streamh), 1, f);
+ printf("stream type: %s\n", chunk_type(streamh.type));
+ printf("stream concealment: %s\n", chunk_type(streamh.concealment));
+ printf("type: %d bytes, stream: %d bytes ID: %d\n",
+ (int)streamh.type_size, (int)streamh.stream_size,
+ (int)streamh.stream_no);
+ printf("FILEPOS=0x%lX\n", ftell(f));
+ // type-specific data:
+ fread(buffer,streamh.type_size,1,f);
+ switch(*((unsigned int*)&streamh.type)){
+ case 0xF8699E40: // guid_audio_stream
+ print_wave_header((WAVEFORMATEX*)buffer);
+ break;
+ case 0xBC19EFC0: // guid_video_stream
+ print_video_header((BITMAPINFOHEADER*)&buffer[4 + 4 + 1 + 2]);
+ break;
+ }
+ // stream-specific data:
+ fread(buffer, streamh.stream_size, 1, f);
break;
- case 0xBC19EFC0: // guid_video_stream
- print_video_header((BITMAPINFOHEADER*)&buffer[4+4+1+2]);
+ //case 0xD6E229D1:
+ // return "guid_header_2_0";
+ case 0x8CABDCA1: // guid_file_header
+ fread(&fileh, sizeof(fileh), 1, f);
+ printf("packets: %d flags: %d pack_size: %d frame_size: %d\n",
+ (int)fileh.packets, (int)fileh.flags, (int)fileh.packetsize,
+ (int)fileh.frame_size);
break;
- }
- // stream-specific data:
- fread(buffer,streamh.stream_size,1,f);
- break;
-// case 0xD6E229D1: return "guid_header_2_0";
- case 0x8CABDCA1: // guid_file_header
- fread(&fileh,sizeof(fileh),1,f);
- printf("packets: %d flags: %d pack_size: %d frame_size: %d\n",(int)fileh.packets,(int)fileh.flags,(int)fileh.packetsize,(int)fileh.frame_size);
- break;
- case 0x75b22636: // guid_data_chunk
- { int endp=pos+objh.size-sizeof(objh);
- unsigned char* packet=malloc((int)fileh.packetsize);
- int fpos;
- fseek(f,26,SEEK_CUR);
- while((fpos=ftell(f))<endp){
- fread(packet,(int)fileh.packetsize,1,f);
- if(packet[0]==0x82){
- unsigned char flags=packet[3];
- unsigned char* p=&packet[5];
- unsigned long time;
- unsigned short duration;
- int segs=1;
- int seg;
- int padding=0;
- if(flags&8){
- padding=p[0];++p;
- } else
- if(flags&16){
- padding=p[0]|(p[1]<<8);p+=2;
- }
- time=*((unsigned long*)p);p+=4;
- duration=*((unsigned short*)p);p+=2;
- if(flags&1){
- segs=p[0]-0x80;++p;
- }
- printf("%08X: flag=%02X segs=%d pad=%d time=%ld dur=%d\n",
- fpos,flags,segs,padding,time,duration);
- for(seg=0;seg<segs;seg++){
- ASF_segmhdr_t* sh=(ASF_segmhdr_t*)p;
- int len=0;
- p+=sizeof(ASF_segmhdr_t);
- if(sh->flag&8) p+=8;// else
- if(sh->flag&1) ++p;
- if(flags&1){
- len=*((unsigned short*)p);p+=2;
+ case 0x75b22636: // guid_data_chunk
+ { int endp = pos + objh.size - sizeof(objh);
+ unsigned char* packet = malloc((int)fileh.packetsize);
+ int fpos;
+ fseek(f, 26, SEEK_CUR);
+ while((fpos = ftell(f)) < endp){
+ fread(packet, (int)fileh.packetsize, 1, f);
+ if(packet[0] == 0x82){
+ unsigned char flags = packet[3];
+ unsigned char* p = &packet[5];
+ unsigned long time;
+ unsigned short duration;
+ int segs = 1;
+ int seg;
+ int padding=0;
+ if(flags & 8){
+ padding = p[0];
+ ++p;
+ } else
+ if(flags & 16){
+ padding = p[0] | (p[1] << 8);
+ p += 2;
}
- printf(" seg #%d: streamno=%d seq=%d flag=%02X len=%d\n",seg,sh->streamno&0x7F,sh->seq,sh->flag,len);
-#ifdef SAVE_STREAMS
- if(!streams[sh->streamno&0x7F]){
- char name[256];
- snprintf(name,256,"stream%02X.dat",sh->streamno&0x7F);
- streams[sh->streamno&0x7F]=fopen(name,"wb");
+ time = *((unsigned long*)p);
+ p += 4;
+ duration = *((unsigned short*)p);
+ p += 2;
+ if(flags & 1){
+ segs = p[0] - 0x80;
+ ++p;
}
- fwrite(p,len,1,streams[sh->streamno&0x7F]);
-#endif
- p+=len;
- }
- } else
- printf("%08X: UNKNOWN %02X %02X %02X %02X %02X...\n",fpos,packet[0],packet[1],packet[2],packet[3],packet[4]);
+ printf("%08X: flag=%02X segs=%d pad=%d time=%ld dur=%d\n",
+ fpos, flags, segs, padding, time, duration);
+ for(seg = 0; seg < segs; seg++){
+ ASF_segmhdr_t* sh = (ASF_segmhdr_t*)p;
+ int len = 0;
+ p += sizeof(ASF_segmhdr_t);
+ if(sh->flag & 8) p+=8;// else
+ if(sh->flag & 1) ++p;
+ if(flags & 1){
+ len = *((unsigned short*)p);
+ p += 2;
+ }
+ printf(" seg #%d: streamno=%d seq=%d flag=%02X len=%d\n",
+ seg, sh->streamno&0x7F, sh->seq, sh->flag, len);
+ #ifdef SAVE_STREAMS
+ if(!streams[sh->streamno & 0x7F]){
+ char name[256];
+ snprintf(name, 256, "stream%02X.dat", sh->streamno & 0x7F);
+ streams[sh->streamno & 0x7F] = fopen(name, "wb");
+ }
+ fwrite(p, len, 1, streams[sh->streamno & 0x7F]);
+ #endif
+ p += len;
+ }
+ } else
+ printf("%08X: UNKNOWN %02X %02X %02X %02X %02X...\n", fpos,
+ packet[0], packet[1], packet[2], packet[3], packet[4]);
+ }
}
- }
- break;
+ break;
-// case 0x33000890: return "guid_index_chunk";
+ //case 0x33000890:
+ // return "guid_index_chunk";
+ }
+ fseek(f, pos + objh.size - sizeof(objh), SEEK_SET);
}
- fseek(f,pos+objh.size-sizeof(objh),SEEK_SET);
-}
-return 0;
+ return 0;
}
diff --git a/command.c b/command.c
index 3a78cf68da..c1559c2d86 100644
--- a/command.c
+++ b/command.c
@@ -452,6 +452,17 @@ static int mp_property_chapter(m_option_t *prop, int action, void *arg,
return M_PROPERTY_OK;
}
+/// Number of chapters in file
+static int mp_property_chapters(m_option_t *prop, int action, void *arg,
+ MPContext *mpctx)
+{
+ if (!mpctx->demuxer)
+ return M_PROPERTY_UNAVAILABLE;
+ if (mpctx->demuxer->num_chapters == 0)
+ stream_control(mpctx->demuxer->stream, STREAM_CTRL_GET_NUM_CHAPTERS, &mpctx->demuxer->num_chapters);
+ return m_property_int_ro(prop, action, arg, mpctx->demuxer->num_chapters);
+}
+
/// Current dvd angle (RW)
static int mp_property_angle(m_option_t *prop, int action, void *arg,
MPContext *mpctx)
@@ -548,6 +559,12 @@ static int mp_property_metadata(m_option_t *prop, int action, void *arg,
return M_PROPERTY_NOT_IMPLEMENTED;
}
+static int mp_property_pause(m_option_t * prop, int action, void *arg,
+ MPContext * mpctx)
+{
+ return m_property_flag_ro(prop, action, arg, mpctx->osd_function == OSD_PAUSE);
+}
+
///@}
@@ -1992,10 +2009,14 @@ static const m_option_t mp_properties[] = {
M_OPT_MIN, 0, 0, NULL },
{ "chapter", mp_property_chapter, CONF_TYPE_INT,
M_OPT_MIN, 1, 0, NULL },
+ { "chapters", mp_property_chapters, CONF_TYPE_INT,
+ 0, 0, 0, NULL },
{ "angle", mp_property_angle, CONF_TYPE_INT,
CONF_RANGE, -2, 10, NULL },
{ "metadata", mp_property_metadata, CONF_TYPE_STRING_LIST,
0, 0, 0, NULL },
+ { "pause", mp_property_pause, CONF_TYPE_FLAG,
+ M_OPT_RANGE, 0, 1, NULL },
// Audio
{ "volume", mp_property_volume, CONF_TYPE_FLOAT,
@@ -2624,7 +2645,7 @@ int run_command(MPContext *mpctx, mp_cmd_t *cmd)
play_tree_add_file(e, cmd->args[0].v.s);
if (cmd->args[1].v.i) // append
- play_tree_append_entry(mpctx->playtree, e);
+ play_tree_append_entry(mpctx->playtree->child, e);
else {
// Go back to the starting point.
while (play_tree_iter_up_step
@@ -2632,7 +2653,7 @@ int run_command(MPContext *mpctx, mp_cmd_t *cmd)
/* NOP */ ;
play_tree_free_list(mpctx->playtree->child, 1);
play_tree_set_child(mpctx->playtree, e);
- play_tree_iter_step(mpctx->playtree_iter, 0, 0);
+