2007-06-17 18:24:49 +02:00
|
|
|
/*****************************************************************************
|
2008-03-30 03:59:32 +02:00
|
|
|
* media.c: Libvlc API media descripor management
|
2007-06-17 18:24:49 +02:00
|
|
|
*****************************************************************************
|
LGPL
Re-license almost all of libVLC and libVLCcore to LGPLv2.1+
This move was authorized by the developers, either:
- by e-mail,
- by vote at the VideoLAN Dev Days 2011,
- on the license website,
- in a contract, oral or written.
No objection was raised, so far.
The developers agreeing are:
Justus Piater
Alexis Ballier
Alexander Bethke
Mohammed Adnène Trojette
Alex Converse
Alexey Sokolov
Alexis de Lattre
Andre Pang
Anthony Loiseau
Cyril Deguet
André Weber
Boris Dorès
Brieuc Jeunhomme
Benjamin Drung
Hugo Beauzée-Luyssen
Benoit Steiner
Benjamin Pracht
Bernie Purcell
Przemyslaw Fiala
Arnaud de Bossoreille de Ribou
Brad Smith
Nick Briggs
Christopher Rath
Christophe Courtaut
Christopher Mueller
Clement Chesnin
Andres Krapf
Damien Fouilleul
David Flynn
Sebastien Zwickert
Antoine Cellerier
Jérôme Decoodt
Jérome Decoodt
Dylan Yudaken
Eduard Babayan
Eugenio Jarosiewicz
Elliot Murphy
Eric Petit
Erwan Tulou
Etienne Membrives
Ludovic Fauvet
Fabio Ritrovato
Tobias Güntner
Jakub Wieczorek
Frédéric Crozat
Francois Cartegnie
Laurent Aimar
Florian G. Pflug
Felix Paul Kühne
Frank Enderle
Rafaël Carré
Simon Latapie
Gildas Bazin
Geoffroy Couprie
Julien / Gellule
Gildas Bazin
Arnaud Schauly
Toralf Niebuhr
Vicente Jimenez Aguilar
Derk-Jan Hartman
Henri Fallon
Ilkka Ollakka
Olivier Teulière
Rémi Duraffort
Jakob Leben
Jean-Baptiste Kempf
Jean-Paul Saman
Jean-Philippe Grimaldi
Jean-François Massol
Gaël Hendryckx
Jakob Leben
Jean-Marc Dressler
Jai Menon
Johan Bilien
Johann Ransay
Joris van Rooij
JP Dinger
Jean-Philippe André
Adrien Grand
Juha Jeronen
Juho Vähä-Herttua
Kaarlo Raiha
Kaarlo Raiha
Kamil Baldyga
Keary Griffin
Ken Self
KO Myung-Hun
Pierre Ynard
Filippo Carone
Loïc Minier
Luca Barbato
Lucas C. Villa Real
Lukas Durfina
Adrien Maglo
Marc Ariberti
Mark Lee
Mark Moriarty
Martin Storsjö
Christophe Massiot
Michel Kaempf
Marian Ďurkovič
Mirsal Ennaime
Carlo Calabrò
Damien Lucas
Naohiro Koriyama
Basos G
Pierre Baillet
Vincent Penquerc'h
Olivier Aubert
Pankaj Yadav
Paul Corke
Pierre d'Herbemont
Philippe Morin
Antoine Lejeune
Michael Ploujnikov
Jean-Marc Dressler
Michael Hanselmann
Rafaël Carré
Ramiro Polla
Rémi Denis-Courmont
Renaud Dartus
Richard Shepherd
Faustino Osuna
Arnaud Vallat
Rob Jonson
Robert Jedrzejczyk
Steve Lhomme
Rocky Bernstein
Romain Goyet
Rov Juvano
Sam Hocevar
Martin T. H. Sandsmark
Sebastian Birk
Sébastien Escudier
Vincent Seguin
Fabio Ritrovato
Sigmund Augdal Helberg
Casian Andrei
Srikanth Raju
Hannes Domani
Stéphane Borel
Stephan Krempel
Stephan Assmus
Tony Castley
Pavlov Konstantin
Eric Petit
Tanguy Krotoff
Dennis van Amerongen
Michel Lespinasse
Can Wu
Xavier Marchesini
Sébastien Toque
Christophe Mutricy
Yoann Peronneau
Yohann Martineau
Yuval Tze
Scott Caudle
Clément Stenac
It is possible, that some minor piece of code was badly tracked, for
some reasons (SVN, mainly) or that some small developers did not answer.
However, as an "œuvre collective", defined as in "CPI 113-2 alinéa 3",
and seeing "Cour. Cass. 17 Mai 1978", and seeing that the editor and
the very vast majority of developers have agreed (> 99.99% of the code,
> 99% of developers), we are fine here.
2011-11-27 21:44:15 +01:00
|
|
|
* Copyright (C) 2007 VLC authors and VideoLAN
|
2007-06-17 18:24:49 +02:00
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
* Authors: Pierre d'Herbemont <pdherbemont@videolan.org>
|
|
|
|
*
|
LGPL
Re-license almost all of libVLC and libVLCcore to LGPLv2.1+
This move was authorized by the developers, either:
- by e-mail,
- by vote at the VideoLAN Dev Days 2011,
- on the license website,
- in a contract, oral or written.
No objection was raised, so far.
The developers agreeing are:
Justus Piater
Alexis Ballier
Alexander Bethke
Mohammed Adnène Trojette
Alex Converse
Alexey Sokolov
Alexis de Lattre
Andre Pang
Anthony Loiseau
Cyril Deguet
André Weber
Boris Dorès
Brieuc Jeunhomme
Benjamin Drung
Hugo Beauzée-Luyssen
Benoit Steiner
Benjamin Pracht
Bernie Purcell
Przemyslaw Fiala
Arnaud de Bossoreille de Ribou
Brad Smith
Nick Briggs
Christopher Rath
Christophe Courtaut
Christopher Mueller
Clement Chesnin
Andres Krapf
Damien Fouilleul
David Flynn
Sebastien Zwickert
Antoine Cellerier
Jérôme Decoodt
Jérome Decoodt
Dylan Yudaken
Eduard Babayan
Eugenio Jarosiewicz
Elliot Murphy
Eric Petit
Erwan Tulou
Etienne Membrives
Ludovic Fauvet
Fabio Ritrovato
Tobias Güntner
Jakub Wieczorek
Frédéric Crozat
Francois Cartegnie
Laurent Aimar
Florian G. Pflug
Felix Paul Kühne
Frank Enderle
Rafaël Carré
Simon Latapie
Gildas Bazin
Geoffroy Couprie
Julien / Gellule
Gildas Bazin
Arnaud Schauly
Toralf Niebuhr
Vicente Jimenez Aguilar
Derk-Jan Hartman
Henri Fallon
Ilkka Ollakka
Olivier Teulière
Rémi Duraffort
Jakob Leben
Jean-Baptiste Kempf
Jean-Paul Saman
Jean-Philippe Grimaldi
Jean-François Massol
Gaël Hendryckx
Jakob Leben
Jean-Marc Dressler
Jai Menon
Johan Bilien
Johann Ransay
Joris van Rooij
JP Dinger
Jean-Philippe André
Adrien Grand
Juha Jeronen
Juho Vähä-Herttua
Kaarlo Raiha
Kaarlo Raiha
Kamil Baldyga
Keary Griffin
Ken Self
KO Myung-Hun
Pierre Ynard
Filippo Carone
Loïc Minier
Luca Barbato
Lucas C. Villa Real
Lukas Durfina
Adrien Maglo
Marc Ariberti
Mark Lee
Mark Moriarty
Martin Storsjö
Christophe Massiot
Michel Kaempf
Marian Ďurkovič
Mirsal Ennaime
Carlo Calabrò
Damien Lucas
Naohiro Koriyama
Basos G
Pierre Baillet
Vincent Penquerc'h
Olivier Aubert
Pankaj Yadav
Paul Corke
Pierre d'Herbemont
Philippe Morin
Antoine Lejeune
Michael Ploujnikov
Jean-Marc Dressler
Michael Hanselmann
Rafaël Carré
Ramiro Polla
Rémi Denis-Courmont
Renaud Dartus
Richard Shepherd
Faustino Osuna
Arnaud Vallat
Rob Jonson
Robert Jedrzejczyk
Steve Lhomme
Rocky Bernstein
Romain Goyet
Rov Juvano
Sam Hocevar
Martin T. H. Sandsmark
Sebastian Birk
Sébastien Escudier
Vincent Seguin
Fabio Ritrovato
Sigmund Augdal Helberg
Casian Andrei
Srikanth Raju
Hannes Domani
Stéphane Borel
Stephan Krempel
Stephan Assmus
Tony Castley
Pavlov Konstantin
Eric Petit
Tanguy Krotoff
Dennis van Amerongen
Michel Lespinasse
Can Wu
Xavier Marchesini
Sébastien Toque
Christophe Mutricy
Yoann Peronneau
Yohann Martineau
Yuval Tze
Scott Caudle
Clément Stenac
It is possible, that some minor piece of code was badly tracked, for
some reasons (SVN, mainly) or that some small developers did not answer.
However, as an "œuvre collective", defined as in "CPI 113-2 alinéa 3",
and seeing "Cour. Cass. 17 Mai 1978", and seeing that the editor and
the very vast majority of developers have agreed (> 99.99% of the code,
> 99% of developers), we are fine here.
2011-11-27 21:44:15 +01:00
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU Lesser General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2.1 of the License, or
|
2007-06-17 18:24:49 +02:00
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
LGPL
Re-license almost all of libVLC and libVLCcore to LGPLv2.1+
This move was authorized by the developers, either:
- by e-mail,
- by vote at the VideoLAN Dev Days 2011,
- on the license website,
- in a contract, oral or written.
No objection was raised, so far.
The developers agreeing are:
Justus Piater
Alexis Ballier
Alexander Bethke
Mohammed Adnène Trojette
Alex Converse
Alexey Sokolov
Alexis de Lattre
Andre Pang
Anthony Loiseau
Cyril Deguet
André Weber
Boris Dorès
Brieuc Jeunhomme
Benjamin Drung
Hugo Beauzée-Luyssen
Benoit Steiner
Benjamin Pracht
Bernie Purcell
Przemyslaw Fiala
Arnaud de Bossoreille de Ribou
Brad Smith
Nick Briggs
Christopher Rath
Christophe Courtaut
Christopher Mueller
Clement Chesnin
Andres Krapf
Damien Fouilleul
David Flynn
Sebastien Zwickert
Antoine Cellerier
Jérôme Decoodt
Jérome Decoodt
Dylan Yudaken
Eduard Babayan
Eugenio Jarosiewicz
Elliot Murphy
Eric Petit
Erwan Tulou
Etienne Membrives
Ludovic Fauvet
Fabio Ritrovato
Tobias Güntner
Jakub Wieczorek
Frédéric Crozat
Francois Cartegnie
Laurent Aimar
Florian G. Pflug
Felix Paul Kühne
Frank Enderle
Rafaël Carré
Simon Latapie
Gildas Bazin
Geoffroy Couprie
Julien / Gellule
Gildas Bazin
Arnaud Schauly
Toralf Niebuhr
Vicente Jimenez Aguilar
Derk-Jan Hartman
Henri Fallon
Ilkka Ollakka
Olivier Teulière
Rémi Duraffort
Jakob Leben
Jean-Baptiste Kempf
Jean-Paul Saman
Jean-Philippe Grimaldi
Jean-François Massol
Gaël Hendryckx
Jakob Leben
Jean-Marc Dressler
Jai Menon
Johan Bilien
Johann Ransay
Joris van Rooij
JP Dinger
Jean-Philippe André
Adrien Grand
Juha Jeronen
Juho Vähä-Herttua
Kaarlo Raiha
Kaarlo Raiha
Kamil Baldyga
Keary Griffin
Ken Self
KO Myung-Hun
Pierre Ynard
Filippo Carone
Loïc Minier
Luca Barbato
Lucas C. Villa Real
Lukas Durfina
Adrien Maglo
Marc Ariberti
Mark Lee
Mark Moriarty
Martin Storsjö
Christophe Massiot
Michel Kaempf
Marian Ďurkovič
Mirsal Ennaime
Carlo Calabrò
Damien Lucas
Naohiro Koriyama
Basos G
Pierre Baillet
Vincent Penquerc'h
Olivier Aubert
Pankaj Yadav
Paul Corke
Pierre d'Herbemont
Philippe Morin
Antoine Lejeune
Michael Ploujnikov
Jean-Marc Dressler
Michael Hanselmann
Rafaël Carré
Ramiro Polla
Rémi Denis-Courmont
Renaud Dartus
Richard Shepherd
Faustino Osuna
Arnaud Vallat
Rob Jonson
Robert Jedrzejczyk
Steve Lhomme
Rocky Bernstein
Romain Goyet
Rov Juvano
Sam Hocevar
Martin T. H. Sandsmark
Sebastian Birk
Sébastien Escudier
Vincent Seguin
Fabio Ritrovato
Sigmund Augdal Helberg
Casian Andrei
Srikanth Raju
Hannes Domani
Stéphane Borel
Stephan Krempel
Stephan Assmus
Tony Castley
Pavlov Konstantin
Eric Petit
Tanguy Krotoff
Dennis van Amerongen
Michel Lespinasse
Can Wu
Xavier Marchesini
Sébastien Toque
Christophe Mutricy
Yoann Peronneau
Yohann Martineau
Yuval Tze
Scott Caudle
Clément Stenac
It is possible, that some minor piece of code was badly tracked, for
some reasons (SVN, mainly) or that some small developers did not answer.
However, as an "œuvre collective", defined as in "CPI 113-2 alinéa 3",
and seeing "Cour. Cass. 17 Mai 1978", and seeing that the editor and
the very vast majority of developers have agreed (> 99.99% of the code,
> 99% of developers), we are fine here.
2011-11-27 21:44:15 +01:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License for more details.
|
2007-06-17 18:24:49 +02:00
|
|
|
*
|
LGPL
Re-license almost all of libVLC and libVLCcore to LGPLv2.1+
This move was authorized by the developers, either:
- by e-mail,
- by vote at the VideoLAN Dev Days 2011,
- on the license website,
- in a contract, oral or written.
No objection was raised, so far.
The developers agreeing are:
Justus Piater
Alexis Ballier
Alexander Bethke
Mohammed Adnène Trojette
Alex Converse
Alexey Sokolov
Alexis de Lattre
Andre Pang
Anthony Loiseau
Cyril Deguet
André Weber
Boris Dorès
Brieuc Jeunhomme
Benjamin Drung
Hugo Beauzée-Luyssen
Benoit Steiner
Benjamin Pracht
Bernie Purcell
Przemyslaw Fiala
Arnaud de Bossoreille de Ribou
Brad Smith
Nick Briggs
Christopher Rath
Christophe Courtaut
Christopher Mueller
Clement Chesnin
Andres Krapf
Damien Fouilleul
David Flynn
Sebastien Zwickert
Antoine Cellerier
Jérôme Decoodt
Jérome Decoodt
Dylan Yudaken
Eduard Babayan
Eugenio Jarosiewicz
Elliot Murphy
Eric Petit
Erwan Tulou
Etienne Membrives
Ludovic Fauvet
Fabio Ritrovato
Tobias Güntner
Jakub Wieczorek
Frédéric Crozat
Francois Cartegnie
Laurent Aimar
Florian G. Pflug
Felix Paul Kühne
Frank Enderle
Rafaël Carré
Simon Latapie
Gildas Bazin
Geoffroy Couprie
Julien / Gellule
Gildas Bazin
Arnaud Schauly
Toralf Niebuhr
Vicente Jimenez Aguilar
Derk-Jan Hartman
Henri Fallon
Ilkka Ollakka
Olivier Teulière
Rémi Duraffort
Jakob Leben
Jean-Baptiste Kempf
Jean-Paul Saman
Jean-Philippe Grimaldi
Jean-François Massol
Gaël Hendryckx
Jakob Leben
Jean-Marc Dressler
Jai Menon
Johan Bilien
Johann Ransay
Joris van Rooij
JP Dinger
Jean-Philippe André
Adrien Grand
Juha Jeronen
Juho Vähä-Herttua
Kaarlo Raiha
Kaarlo Raiha
Kamil Baldyga
Keary Griffin
Ken Self
KO Myung-Hun
Pierre Ynard
Filippo Carone
Loïc Minier
Luca Barbato
Lucas C. Villa Real
Lukas Durfina
Adrien Maglo
Marc Ariberti
Mark Lee
Mark Moriarty
Martin Storsjö
Christophe Massiot
Michel Kaempf
Marian Ďurkovič
Mirsal Ennaime
Carlo Calabrò
Damien Lucas
Naohiro Koriyama
Basos G
Pierre Baillet
Vincent Penquerc'h
Olivier Aubert
Pankaj Yadav
Paul Corke
Pierre d'Herbemont
Philippe Morin
Antoine Lejeune
Michael Ploujnikov
Jean-Marc Dressler
Michael Hanselmann
Rafaël Carré
Ramiro Polla
Rémi Denis-Courmont
Renaud Dartus
Richard Shepherd
Faustino Osuna
Arnaud Vallat
Rob Jonson
Robert Jedrzejczyk
Steve Lhomme
Rocky Bernstein
Romain Goyet
Rov Juvano
Sam Hocevar
Martin T. H. Sandsmark
Sebastian Birk
Sébastien Escudier
Vincent Seguin
Fabio Ritrovato
Sigmund Augdal Helberg
Casian Andrei
Srikanth Raju
Hannes Domani
Stéphane Borel
Stephan Krempel
Stephan Assmus
Tony Castley
Pavlov Konstantin
Eric Petit
Tanguy Krotoff
Dennis van Amerongen
Michel Lespinasse
Can Wu
Xavier Marchesini
Sébastien Toque
Christophe Mutricy
Yoann Peronneau
Yohann Martineau
Yuval Tze
Scott Caudle
Clément Stenac
It is possible, that some minor piece of code was badly tracked, for
some reasons (SVN, mainly) or that some small developers did not answer.
However, as an "œuvre collective", defined as in "CPI 113-2 alinéa 3",
and seeing "Cour. Cass. 17 Mai 1978", and seeing that the editor and
the very vast majority of developers have agreed (> 99.99% of the code,
> 99% of developers), we are fine here.
2011-11-27 21:44:15 +01:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
|
2007-06-17 18:24:49 +02:00
|
|
|
*****************************************************************************/
|
|
|
|
|
2009-05-25 15:09:40 +02:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
2009-10-05 20:52:49 +02:00
|
|
|
#include <assert.h>
|
|
|
|
|
2007-06-17 18:24:49 +02:00
|
|
|
#include <vlc/libvlc.h>
|
2009-05-25 10:47:38 +02:00
|
|
|
#include <vlc/libvlc_media.h>
|
|
|
|
#include <vlc/libvlc_media_list.h> // For the subitems, here for convenience
|
|
|
|
#include <vlc/libvlc_events.h>
|
|
|
|
|
|
|
|
#include <vlc_common.h>
|
2007-06-17 18:24:49 +02:00
|
|
|
#include <vlc_input.h>
|
|
|
|
#include <vlc_meta.h>
|
2009-05-25 10:47:38 +02:00
|
|
|
#include <vlc_playlist.h> /* For the preparser */
|
2010-02-18 18:56:15 +01:00
|
|
|
#include <vlc_url.h>
|
2007-06-17 18:24:49 +02:00
|
|
|
|
2011-08-30 22:40:14 +02:00
|
|
|
#include "../src/libvlc.h"
|
2009-05-25 10:47:38 +02:00
|
|
|
|
|
|
|
#include "libvlc_internal.h"
|
|
|
|
#include "media_internal.h"
|
2007-08-22 18:49:43 +02:00
|
|
|
|
2007-08-15 20:27:49 +02:00
|
|
|
static const vlc_meta_type_t libvlc_to_vlc_meta[] =
|
|
|
|
{
|
|
|
|
[libvlc_meta_Title] = vlc_meta_Title,
|
|
|
|
[libvlc_meta_Artist] = vlc_meta_Artist,
|
|
|
|
[libvlc_meta_Genre] = vlc_meta_Genre,
|
|
|
|
[libvlc_meta_Copyright] = vlc_meta_Copyright,
|
|
|
|
[libvlc_meta_Album] = vlc_meta_Album,
|
|
|
|
[libvlc_meta_TrackNumber] = vlc_meta_TrackNumber,
|
|
|
|
[libvlc_meta_Description] = vlc_meta_Description,
|
|
|
|
[libvlc_meta_Rating] = vlc_meta_Rating,
|
|
|
|
[libvlc_meta_Date] = vlc_meta_Date,
|
|
|
|
[libvlc_meta_Setting] = vlc_meta_Setting,
|
|
|
|
[libvlc_meta_URL] = vlc_meta_URL,
|
|
|
|
[libvlc_meta_Language] = vlc_meta_Language,
|
|
|
|
[libvlc_meta_NowPlaying] = vlc_meta_NowPlaying,
|
|
|
|
[libvlc_meta_Publisher] = vlc_meta_Publisher,
|
|
|
|
[libvlc_meta_EncodedBy] = vlc_meta_EncodedBy,
|
|
|
|
[libvlc_meta_ArtworkURL] = vlc_meta_ArtworkURL,
|
|
|
|
[libvlc_meta_TrackID] = vlc_meta_TrackID
|
|
|
|
};
|
|
|
|
|
2009-07-06 04:50:03 +02:00
|
|
|
static const libvlc_meta_t vlc_to_libvlc_meta[] =
|
2007-08-15 20:27:49 +02:00
|
|
|
{
|
|
|
|
[vlc_meta_Title] = libvlc_meta_Title,
|
|
|
|
[vlc_meta_Artist] = libvlc_meta_Artist,
|
|
|
|
[vlc_meta_Genre] = libvlc_meta_Genre,
|
|
|
|
[vlc_meta_Copyright] = libvlc_meta_Copyright,
|
|
|
|
[vlc_meta_Album] = libvlc_meta_Album,
|
|
|
|
[vlc_meta_TrackNumber] = libvlc_meta_TrackNumber,
|
|
|
|
[vlc_meta_Description] = libvlc_meta_Description,
|
|
|
|
[vlc_meta_Rating] = libvlc_meta_Rating,
|
|
|
|
[vlc_meta_Date] = libvlc_meta_Date,
|
|
|
|
[vlc_meta_Setting] = libvlc_meta_Setting,
|
|
|
|
[vlc_meta_URL] = libvlc_meta_URL,
|
|
|
|
[vlc_meta_Language] = libvlc_meta_Language,
|
|
|
|
[vlc_meta_NowPlaying] = libvlc_meta_NowPlaying,
|
|
|
|
[vlc_meta_Publisher] = libvlc_meta_Publisher,
|
|
|
|
[vlc_meta_EncodedBy] = libvlc_meta_EncodedBy,
|
|
|
|
[vlc_meta_ArtworkURL] = libvlc_meta_ArtworkURL,
|
|
|
|
[vlc_meta_TrackID] = libvlc_meta_TrackID
|
|
|
|
};
|
|
|
|
|
2007-08-16 20:05:07 +02:00
|
|
|
/**************************************************************************
|
|
|
|
* input_item_subitem_added (Private) (vlc event Callback)
|
|
|
|
**************************************************************************/
|
|
|
|
static void input_item_subitem_added( const vlc_event_t *p_event,
|
2007-08-20 00:46:15 +02:00
|
|
|
void * user_data )
|
2007-08-16 20:05:07 +02:00
|
|
|
{
|
2008-03-30 03:59:32 +02:00
|
|
|
libvlc_media_t * p_md = user_data;
|
|
|
|
libvlc_media_t * p_md_child;
|
2007-08-16 20:05:07 +02:00
|
|
|
libvlc_event_t event;
|
|
|
|
|
2008-03-30 03:59:32 +02:00
|
|
|
p_md_child = libvlc_media_new_from_input_item(
|
2007-09-10 20:56:52 +02:00
|
|
|
p_md->p_libvlc_instance,
|
2010-02-02 22:44:43 +01:00
|
|
|
p_event->u.input_item_subitem_added.p_new_child );
|
2007-08-16 20:05:07 +02:00
|
|
|
|
2007-08-21 21:43:04 +02:00
|
|
|
/* Add this to our media list */
|
|
|
|
if( !p_md->p_subitems )
|
2007-08-29 02:03:55 +02:00
|
|
|
{
|
2010-01-28 21:49:15 +01:00
|
|
|
p_md->p_subitems = libvlc_media_list_new( p_md->p_libvlc_instance );
|
2010-01-24 10:45:14 +01:00
|
|
|
libvlc_media_list_set_media( p_md->p_subitems, p_md );
|
2007-08-29 02:03:55 +02:00
|
|
|
}
|
2007-08-25 19:40:11 +02:00
|
|
|
if( p_md->p_subitems )
|
2007-08-21 21:43:04 +02:00
|
|
|
{
|
2010-02-03 19:06:21 +01:00
|
|
|
libvlc_media_list_add_media( p_md->p_subitems, p_md_child );
|
2007-08-21 21:43:04 +02:00
|
|
|
}
|
|
|
|
|
2007-08-16 20:05:07 +02:00
|
|
|
/* Construct the event */
|
2008-03-31 06:35:08 +02:00
|
|
|
event.type = libvlc_MediaSubItemAdded;
|
2008-03-30 03:59:32 +02:00
|
|
|
event.u.media_subitem_added.new_child = p_md_child;
|
2007-08-16 20:05:07 +02:00
|
|
|
|
|
|
|
/* Send the event */
|
|
|
|
libvlc_event_send( p_md->p_event_manager, &event );
|
2008-03-30 03:59:32 +02:00
|
|
|
libvlc_media_release( p_md_child );
|
2007-08-16 20:05:07 +02:00
|
|
|
}
|
|
|
|
|
2007-08-15 20:27:49 +02:00
|
|
|
/**************************************************************************
|
|
|
|
* input_item_meta_changed (Private) (vlc event Callback)
|
|
|
|
**************************************************************************/
|
|
|
|
static void input_item_meta_changed( const vlc_event_t *p_event,
|
|
|
|
void * user_data )
|
|
|
|
{
|
2008-03-30 03:59:32 +02:00
|
|
|
libvlc_media_t * p_md = user_data;
|
2007-08-15 20:27:49 +02:00
|
|
|
libvlc_event_t event;
|
|
|
|
|
|
|
|
/* Construct the event */
|
2008-03-31 06:35:08 +02:00
|
|
|
event.type = libvlc_MediaMetaChanged;
|
2008-03-30 03:59:32 +02:00
|
|
|
event.u.media_meta_changed.meta_type =
|
2007-08-15 20:27:49 +02:00
|
|
|
vlc_to_libvlc_meta[p_event->u.input_item_meta_changed.meta_type];
|
|
|
|
|
|
|
|
/* Send the event */
|
|
|
|
libvlc_event_send( p_md->p_event_manager, &event );
|
|
|
|
}
|
|
|
|
|
2007-10-20 19:56:00 +02:00
|
|
|
/**************************************************************************
|
|
|
|
* input_item_duration_changed (Private) (vlc event Callback)
|
|
|
|
**************************************************************************/
|
|
|
|
static void input_item_duration_changed( const vlc_event_t *p_event,
|
|
|
|
void * user_data )
|
|
|
|
{
|
2008-03-30 03:59:32 +02:00
|
|
|
libvlc_media_t * p_md = user_data;
|
2007-10-20 19:56:00 +02:00
|
|
|
libvlc_event_t event;
|
|
|
|
|
|
|
|
/* Construct the event */
|
2008-03-31 06:35:08 +02:00
|
|
|
event.type = libvlc_MediaDurationChanged;
|
2010-01-16 16:11:08 +01:00
|
|
|
event.u.media_duration_changed.new_duration =
|
|
|
|
from_mtime(p_event->u.input_item_duration_changed.new_duration);
|
2007-10-20 19:56:00 +02:00
|
|
|
|
|
|
|
/* Send the event */
|
|
|
|
libvlc_event_send( p_md->p_event_manager, &event );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
* input_item_preparsed_changed (Private) (vlc event Callback)
|
|
|
|
**************************************************************************/
|
2010-02-22 17:23:14 +01:00
|
|
|
static void input_item_preparsed_changed(const vlc_event_t *p_event,
|
|
|
|
void * user_data)
|
2007-10-20 19:56:00 +02:00
|
|
|
{
|
2010-02-22 17:23:14 +01:00
|
|
|
libvlc_media_t *media = user_data;
|
2007-10-20 19:56:00 +02:00
|
|
|
libvlc_event_t event;
|
|
|
|
|
2010-02-22 17:23:14 +01:00
|
|
|
/* Eventually notify libvlc_media_parse() */
|
|
|
|
vlc_mutex_lock(&media->parsed_lock);
|
|
|
|
media->is_parsed = true;
|
|
|
|
vlc_cond_broadcast(&media->parsed_cond);
|
|
|
|
vlc_mutex_unlock(&media->parsed_lock);
|
|
|
|
|
|
|
|
|
2007-10-20 19:56:00 +02:00
|
|
|
/* Construct the event */
|
2010-02-22 18:34:32 +01:00
|
|
|
event.type = libvlc_MediaParsedChanged;
|
|
|
|
event.u.media_parsed_changed.new_status =
|
2007-10-20 19:56:00 +02:00
|
|
|
p_event->u.input_item_preparsed_changed.new_status;
|
|
|
|
|
|
|
|
/* Send the event */
|
2010-02-22 17:23:14 +01:00
|
|
|
libvlc_event_send(media->p_event_manager, &event);
|
2007-10-20 19:56:00 +02:00
|
|
|
}
|
2007-08-15 20:27:49 +02:00
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
* Install event handler (Private)
|
|
|
|
**************************************************************************/
|
2008-03-30 03:59:32 +02:00
|
|
|
static void install_input_item_observer( libvlc_media_t *p_md )
|
2007-08-15 20:27:49 +02:00
|
|
|
{
|
2007-08-16 20:05:07 +02:00
|
|
|
vlc_event_attach( &p_md->p_input_item->event_manager,
|
|
|
|
vlc_InputItemSubItemAdded,
|
|
|
|
input_item_subitem_added,
|
|
|
|
p_md );
|
2007-08-15 20:27:49 +02:00
|
|
|
vlc_event_attach( &p_md->p_input_item->event_manager,
|
|
|
|
vlc_InputItemMetaChanged,
|
|
|
|
input_item_meta_changed,
|
|
|
|
p_md );
|
2007-10-20 19:56:00 +02:00
|
|
|
vlc_event_attach( &p_md->p_input_item->event_manager,
|
|
|
|
vlc_InputItemDurationChanged,
|
|
|
|
input_item_duration_changed,
|
|
|
|
p_md );
|
|
|
|
vlc_event_attach( &p_md->p_input_item->event_manager,
|
|
|
|
vlc_InputItemPreparsedChanged,
|
|
|
|
input_item_preparsed_changed,
|
|
|
|
p_md );
|
2007-08-15 20:27:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
* Uninstall event handler (Private)
|
|
|
|
**************************************************************************/
|
2008-03-30 03:59:32 +02:00
|
|
|
static void uninstall_input_item_observer( libvlc_media_t *p_md )
|
2007-08-15 20:27:49 +02:00
|
|
|
{
|
2007-08-16 20:05:07 +02:00
|
|
|
vlc_event_detach( &p_md->p_input_item->event_manager,
|
|
|
|
vlc_InputItemSubItemAdded,
|
|
|
|
input_item_subitem_added,
|
|
|
|
p_md );
|
2007-08-15 20:27:49 +02:00
|
|
|
vlc_event_detach( &p_md->p_input_item->event_manager,
|
|
|
|
vlc_InputItemMetaChanged,
|
|
|
|
input_item_meta_changed,
|
|
|
|
p_md );
|
2007-10-20 19:56:00 +02:00
|
|
|
vlc_event_detach( &p_md->p_input_item->event_manager,
|
|
|
|
vlc_InputItemDurationChanged,
|
|
|
|
input_item_duration_changed,
|
|
|
|
p_md );
|
|
|
|
vlc_event_detach( &p_md->p_input_item->event_manager,
|
|
|
|
vlc_InputItemPreparsedChanged,
|
|
|
|
input_item_preparsed_changed,
|
|
|
|
p_md );
|
2007-08-15 20:27:49 +02:00
|
|
|
}
|
2007-06-17 18:24:49 +02:00
|
|
|
|
|
|
|
/**************************************************************************
|
2007-08-15 20:27:49 +02:00
|
|
|
* Create a new media descriptor object from an input_item
|
|
|
|
* (libvlc internal)
|
|
|
|
* That's the generic constructor
|
2007-06-17 18:24:49 +02:00
|
|
|
**************************************************************************/
|
2008-03-30 03:59:32 +02:00
|
|
|
libvlc_media_t * libvlc_media_new_from_input_item(
|
2007-06-17 18:24:49 +02:00
|
|
|
libvlc_instance_t *p_instance,
|
2010-02-02 22:44:43 +01:00
|
|
|
input_item_t *p_input_item )
|
2007-06-17 18:24:49 +02:00
|
|
|
{
|
2008-03-30 03:59:32 +02:00
|
|
|
libvlc_media_t * p_md;
|
2007-06-17 18:24:49 +02:00
|
|
|
|
|
|
|
if (!p_input_item)
|
2007-06-24 13:19:48 +02:00
|
|
|
{
|
2009-09-07 21:13:49 +02:00
|
|
|
libvlc_printerr( "No input item given" );
|
2007-06-24 13:19:48 +02:00
|
|
|
return NULL;
|
|
|
|
}
|
2007-06-17 18:24:49 +02:00
|
|
|
|
2010-01-19 14:32:31 +01:00
|
|
|
p_md = calloc( 1, sizeof(libvlc_media_t) );
|
2008-05-18 13:09:26 +02:00
|
|
|
if( !p_md )
|
|
|
|
{
|
2009-09-07 21:13:49 +02:00
|
|
|
libvlc_printerr( "Not enough memory" );
|
2008-05-18 13:09:26 +02:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2007-07-09 22:52:11 +02:00
|
|
|
p_md->p_libvlc_instance = p_instance;
|
|
|
|
p_md->p_input_item = p_input_item;
|
2007-08-08 23:12:02 +02:00
|
|
|
p_md->i_refcount = 1;
|
2007-12-24 19:45:10 +01:00
|
|
|
|
2010-02-22 17:23:14 +01:00
|
|
|
vlc_cond_init(&p_md->parsed_cond);
|
|
|
|
vlc_mutex_init(&p_md->parsed_lock);
|
|
|
|
|
2007-12-24 19:45:10 +01:00
|
|
|
p_md->state = libvlc_NothingSpecial;
|
2007-08-16 20:05:07 +02:00
|
|
|
|
2007-08-21 21:43:04 +02:00
|
|
|
/* A media descriptor can be a playlist. When you open a playlist
|
|
|
|
* It can give a bunch of item to read. */
|
|
|
|
p_md->p_subitems = NULL;
|
|
|
|
|
2010-01-25 18:19:19 +01:00
|
|
|
p_md->p_event_manager = libvlc_event_manager_new( p_md, p_instance );
|
|
|
|
if( unlikely(p_md->p_event_manager == NULL) )
|
|
|
|
{
|
|
|
|
free(p_md);
|
|
|
|
return NULL;
|
|
|
|
}
|
2010-02-22 18:34:32 +01:00
|
|
|
|
|
|
|
libvlc_event_manager_t *em = p_md->p_event_manager;
|
|
|
|
libvlc_event_manager_register_event_type(em, libvlc_MediaMetaChanged);
|
|
|
|
libvlc_event_manager_register_event_type(em, libvlc_MediaSubItemAdded);
|
|
|
|
libvlc_event_manager_register_event_type(em, libvlc_MediaFreed);
|
|
|
|
libvlc_event_manager_register_event_type(em, libvlc_MediaDurationChanged);
|
|
|
|
libvlc_event_manager_register_event_type(em, libvlc_MediaStateChanged);
|
|
|
|
libvlc_event_manager_register_event_type(em, libvlc_MediaParsedChanged);
|
2007-08-16 20:05:07 +02:00
|
|
|
|
2007-07-09 22:52:11 +02:00
|
|
|
vlc_gc_incref( p_md->p_input_item );
|
2007-06-17 18:24:49 +02:00
|
|
|
|
2007-08-15 20:27:49 +02:00
|
|
|
install_input_item_observer( p_md );
|
|
|
|
|
2007-07-09 22:52:11 +02:00
|
|
|
return p_md;
|
2007-06-17 18:24:49 +02:00
|
|
|
}
|
|
|
|
|
2007-06-17 22:54:32 +02:00
|
|
|
/**************************************************************************
|
2007-08-15 20:27:49 +02:00
|
|
|
* Create a new media descriptor object
|
2007-06-17 22:54:32 +02:00
|
|
|
**************************************************************************/
|
2010-02-18 18:56:15 +01:00
|
|
|
libvlc_media_t *libvlc_media_new_location( libvlc_instance_t *p_instance,
|
|
|
|
const char * psz_mrl )
|
2007-06-17 22:54:32 +02:00
|
|
|
{
|
2007-08-15 20:27:49 +02:00
|
|
|
input_item_t * p_input_item;
|
2008-03-30 03:59:32 +02:00
|
|
|
libvlc_media_t * p_md;
|
2007-06-17 22:54:32 +02:00
|
|
|
|
2011-07-10 17:23:41 +02:00
|
|
|
p_input_item = input_item_New( psz_mrl, NULL );
|
2007-08-15 20:27:49 +02:00
|
|
|
|
2007-06-17 22:54:32 +02:00
|
|
|
if (!p_input_item)
|
2007-06-24 13:19:48 +02:00
|
|
|
{
|
2009-09-07 21:13:49 +02:00
|
|
|
libvlc_printerr( "Not enough memory" );
|
2007-06-24 13:19:48 +02:00
|
|
|
return NULL;
|
|
|
|
}
|
2007-06-17 22:54:32 +02:00
|
|
|
|
2010-02-02 22:44:43 +01:00
|
|
|
p_md = libvlc_media_new_from_input_item( p_instance, p_input_item );
|
2007-06-17 22:54:32 +02:00
|
|
|
|
2008-03-30 03:59:32 +02:00
|
|
|
/* The p_input_item is retained in libvlc_media_new_from_input_item */
|
2007-12-23 15:45:09 +01:00
|
|
|
vlc_gc_decref( p_input_item );
|
2008-05-18 13:09:26 +02:00
|
|
|
|
2007-07-09 22:52:11 +02:00
|
|
|
return p_md;
|
2007-06-17 22:54:32 +02:00
|
|
|
}
|
|
|
|
|
2010-02-18 18:56:15 +01:00
|
|
|
libvlc_media_t *libvlc_media_new_path( libvlc_instance_t *p_instance,
|
|
|
|
const char *path )
|
|
|
|
{
|
2013-06-10 21:15:45 +02:00
|
|
|
char *mrl = vlc_path2uri( path, NULL );
|
2010-02-18 18:56:15 +01:00
|
|
|
if( unlikely(mrl == NULL) )
|
|
|
|
{
|
|
|
|
libvlc_printerr( "Not enough memory" );
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
libvlc_media_t *m = libvlc_media_new_location( p_instance, mrl );
|
|
|
|
free( mrl );
|
|
|
|
return m;
|
|
|
|
}
|
|
|
|
|
2010-11-06 17:40:26 +01:00
|
|
|
libvlc_media_t *libvlc_media_new_fd( libvlc_instance_t *p_instance, int fd )
|
|
|
|
{
|
|
|
|
char mrl[16];
|
|
|
|
snprintf( mrl, sizeof(mrl), "fd://%d", fd );
|
|
|
|
|
|
|
|
return libvlc_media_new_location( p_instance, mrl );
|
|
|
|
}
|
|
|
|
|
2007-12-20 00:10:31 +01:00
|
|
|
/**************************************************************************
|
|
|
|
* Create a new media descriptor object
|
|
|
|
**************************************************************************/
|
2010-02-02 22:44:43 +01:00
|
|
|
libvlc_media_t * libvlc_media_new_as_node( libvlc_instance_t *p_instance,
|
|
|
|
const char * psz_name )
|
2007-12-20 00:10:31 +01:00
|
|
|
{
|
|
|
|
input_item_t * p_input_item;
|
2008-03-30 03:59:32 +02:00
|
|
|
libvlc_media_t * p_md;
|
2007-12-20 00:10:31 +01:00
|
|
|
|
2011-07-10 17:23:41 +02:00
|
|
|
p_input_item = input_item_New( "vlc://nop", psz_name );
|
2007-12-20 00:10:31 +01:00
|
|
|
|
|
|
|
if (!p_input_item)
|
|
|
|
{
|
2009-09-07 21:13:49 +02:00
|
|
|
libvlc_printerr( "Not enough memory" );
|
2007-12-20 00:10:31 +01:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2010-02-02 22:44:43 +01:00
|
|
|
p_md = libvlc_media_new_from_input_item( p_instance, p_input_item );
|
2007-12-20 00:10:31 +01:00
|
|
|
|
2010-01-28 21:49:15 +01:00
|
|
|
p_md->p_subitems = libvlc_media_list_new( p_md->p_libvlc_instance );
|
2007-12-20 00:10:31 +01:00
|
|
|
|
|
|
|
return p_md;
|
|
|
|
}
|
|
|
|
|
2007-12-14 15:33:06 +01:00
|
|
|
/**************************************************************************
|
|
|
|
* Add an option to the media descriptor,
|
2008-03-30 03:59:32 +02:00
|
|
|
* that will be used to determine how the media_player will read the
|
|
|
|
* media. This allow to use VLC advanced reading/streaming
|
2007-12-14 15:33:06 +01:00
|
|
|
* options in a per-media basis
|
|
|
|
*
|
|
|
|
* The options are detailled in vlc --long-help, for instance "--sout-all"
|
|
|
|
**************************************************************************/
|
2010-02-04 17:07:15 +01:00
|
|
|
void libvlc_media_add_option( libvlc_media_t * p_md,
|
|
|
|
const char * psz_option )
|
2007-12-14 15:33:06 +01:00
|
|
|
{
|
2010-02-04 17:07:15 +01:00
|
|
|
libvlc_media_add_option_flag( p_md, psz_option,
|
2009-01-17 17:37:23 +01:00
|
|
|
VLC_INPUT_OPTION_UNIQUE|VLC_INPUT_OPTION_TRUSTED );
|
2007-12-14 15:33:06 +01:00
|
|
|
}
|
|
|
|
|
2009-01-28 20:20:21 +01:00
|
|
|
/**************************************************************************
|
2009-06-19 00:05:50 +02:00
|
|
|
* Same as libvlc_media_add_option but with configurable flags.
|
2009-01-28 20:20:21 +01:00
|
|
|
**************************************************************************/
|
2010-02-04 17:07:15 +01:00
|
|
|
void libvlc_media_add_option_flag( libvlc_media_t * p_md,
|
2009-01-28 20:20:21 +01:00
|
|
|
const char * ppsz_option,
|
2010-02-04 17:07:15 +01:00
|
|
|
unsigned i_flags )
|
2009-01-28 20:20:21 +01:00
|
|
|
{
|
2010-02-04 17:07:15 +01:00
|
|
|
input_item_AddOption( p_md->p_input_item, ppsz_option, i_flags );
|
2009-01-28 20:20:21 +01:00
|
|
|
}
|
|
|
|
|
2007-06-17 18:24:49 +02:00
|
|
|
/**************************************************************************
|
|
|
|
* Delete a media descriptor object
|
|
|
|
**************************************************************************/
|
2008-03-30 03:59:32 +02:00
|
|
|
void libvlc_media_release( libvlc_media_t *p_md )
|
2007-06-17 18:24:49 +02:00
|
|
|
{
|
2007-06-17 22:54:32 +02:00
|
|
|
if (!p_md)
|
2007-06-17 18:24:49 +02:00
|
|
|
return;
|
|
|
|
|
2007-08-08 23:12:02 +02:00
|
|
|
p_md->i_refcount--;
|
|
|
|
|
|
|
|
if( p_md->i_refcount > 0 )
|
|
|
|
return;
|
2007-08-15 20:27:49 +02:00
|
|
|
|
2007-08-24 23:54:27 +02:00
|
|
|
if( p_md->p_subitems )
|
|
|
|
libvlc_media_list_release( p_md->p_subitems );
|
2007-08-21 21:43:04 +02:00
|
|
|
|
2007-08-15 20:27:49 +02:00
|
|
|
uninstall_input_item_observer( p_md );
|
|
|
|
vlc_gc_decref( p_md->p_input_item );
|
|
|
|
|
2010-02-22 19:52:20 +01:00
|
|
|
vlc_cond_destroy( &p_md->parsed_cond );
|
|
|
|
vlc_mutex_destroy( &p_md->parsed_lock );
|
|
|
|
|
2007-10-25 14:30:03 +02:00
|
|
|
/* Construct the event */
|
|
|
|
libvlc_event_t event;
|
2008-03-31 06:35:08 +02:00
|
|
|
event.type = libvlc_MediaFreed;
|
2008-03-30 03:59:32 +02:00
|
|
|
event.u.media_freed.md = p_md;
|
2007-10-25 14:30:03 +02:00
|
|
|
|
|
|
|
/* Send the event */
|
|
|
|
libvlc_event_send( p_md->p_event_manager, &event );
|
|
|
|
|
2007-11-20 13:07:38 +01:00
|
|
|
libvlc_event_manager_release( p_md->p_event_manager );
|
|
|
|
|
2007-06-17 22:54:32 +02:00
|
|
|
free( p_md );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************************
|
2007-08-08 23:12:02 +02:00
|
|
|
* Retain a media descriptor object
|
|
|
|
**************************************************************************/
|
2008-03-30 03:59:32 +02:00
|
|
|
void libvlc_media_retain( libvlc_media_t *p_md )
|
2007-08-08 23:12:02 +02:00
|
|
|
{
|
2009-10-05 20:58:34 +02:00
|
|
|
assert (p_md);
|
2007-08-08 23:12:02 +02:00
|
|
|
p_md->i_refcount++;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
* Duplicate a media descriptor object
|
2007-06-17 22:54:32 +02:00
|
|
|
**************************************************************************/
|
2008-03-30 03:59:32 +02:00
|
|
|
libvlc_media_t *
|
|
|
|
libvlc_media_duplicate( libvlc_media_t *p_md_orig )
|
2007-06-17 22:54:32 +02:00
|
|
|
{
|
2008-03-30 03:59:32 +02:00
|
|
|
return libvlc_media_new_from_input_item(
|
2010-02-02 22:44:43 +01:00
|
|
|
p_md_orig->p_libvlc_instance, p_md_orig->p_input_item );
|
2007-06-17 18:24:49 +02:00
|
|
|
}
|
|
|
|
|
2007-08-09 18:08:14 +02:00
|
|
|
/**************************************************************************
|
2008-08-08 08:29:16 +02:00
|
|
|
* Get mrl from a media descriptor object
|
2007-08-09 18:08:14 +02:00
|
|
|
**************************************************************************/
|
|
|
|
char *
|
2009-10-05 20:41:21 +02:00
|
|
|
libvlc_media_get_mrl( libvlc_media_t * p_md )
|
2007-08-09 18:08:14 +02:00
|
|
|
{
|
2009-10-05 20:41:21 +02:00
|
|
|
assert( p_md );
|
2007-08-22 22:19:23 +02:00
|
|
|
return input_item_GetURI( p_md->p_input_item );
|
2007-08-09 18:08:14 +02:00
|
|
|
}
|
|
|
|
|
2007-06-17 18:24:49 +02:00
|
|
|
/**************************************************************************
|
2007-06-17 22:54:32 +02:00
|
|
|
* Getter for meta information
|
2007-06-17 18:24:49 +02:00
|
|
|
**************************************************************************/
|
|
|
|
|
2009-10-05 20:41:21 +02:00
|
|
|
char *libvlc_media_get_meta( libvlc_media_t *p_md, libvlc_meta_t e_meta )
|
2007-06-17 18:24:49 +02:00
|
|
|
{
|
2011-07-10 18:31:09 +02:00
|
|
|
char *psz_meta = input_item_GetMeta( p_md->p_input_item,
|
|
|
|
libvlc_to_vlc_meta[e_meta] );
|
2007-08-15 19:53:27 +02:00
|
|
|
/* Should be integrated in core */
|
2011-07-10 18:09:58 +02:00
|
|
|
if( psz_meta == NULL && e_meta == libvlc_meta_Title
|
|
|
|
&& p_md->p_input_item->psz_name != NULL )
|
|
|
|
psz_meta = strdup( p_md->p_input_item->psz_name );
|
2007-08-15 19:53:27 +02:00
|
|
|
|
2007-08-18 05:22:03 +02:00
|
|
|
return psz_meta;
|
2007-06-17 18:24:49 +02:00
|
|
|
}
|
2007-07-09 22:52:11 +02:00
|
|
|
|
2009-12-08 10:04:53 +01:00
|
|
|
/**************************************************************************
|
|
|
|
* Setter for meta information
|
|
|
|
**************************************************************************/
|
|
|
|
|
|
|
|
void libvlc_media_set_meta( libvlc_media_t *p_md, libvlc_meta_t e_meta, const char *psz_value )
|
|
|
|
{
|
|
|
|
assert( p_md );
|
|
|
|
input_item_SetMeta( p_md->p_input_item, libvlc_to_vlc_meta[e_meta], psz_value );
|
|
|
|
}
|
|
|
|
|
|
|
|
int libvlc_media_save_meta( libvlc_media_t *p_md )
|
|
|
|
{
|
|
|
|
assert( p_md );
|
2012-08-21 19:37:00 +02:00
|
|
|
vlc_object_t *p_obj = VLC_OBJECT(p_md->p_libvlc_instance->p_libvlc_int);
|
2009-12-08 10:04:53 +01:00
|
|
|
return input_item_WriteMeta( p_obj, p_md->p_input_item ) == VLC_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2007-12-24 19:45:10 +01:00
|
|
|
/**************************************************************************
|
|
|
|
* Getter for state information
|
|
|
|
* Can be error, playing, buffering, NothingSpecial.
|
|
|
|
**************************************************************************/
|
|
|
|
|
2009-07-06 04:50:03 +02:00
|
|
|
libvlc_state_t
|
2009-10-05 20:41:21 +02:00
|
|
|
libvlc_media_get_state( libvlc_media_t *p_md )
|
2007-12-24 19:45:10 +01:00
|
|
|
{
|
2009-10-05 20:41:21 +02:00
|
|
|
assert( p_md );
|
2007-12-24 19:45:10 +01:00
|
|
|
return p_md->state;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
* Setter for state information (LibVLC Internal)
|
|
|
|
**************************************************************************/
|
|
|
|
|
|
|
|
void
|
2009-07-06 04:50:03 +02:00
|
|
|
libvlc_media_set_state( libvlc_media_t *p_md,
|
2009-10-05 20:41:21 +02:00
|
|
|
libvlc_state_t state )
|
2007-12-24 19:45:10 +01:00
|
|
|
{
|
|
|
|
libvlc_event_t event;
|
|
|
|
|
|
|
|
p_md->state = state;
|
|
|
|
|
|
|
|
/* Construct the event */
|
2008-03-31 06:35:08 +02:00
|
|
|
event.type = libvlc_MediaStateChanged;
|
2008-03-30 03:59:32 +02:00
|
|
|
event.u.media_state_changed.new_state = state;
|
2007-12-24 19:45:10 +01:00
|
|
|
|
|
|
|
/* Send the event */
|
|
|
|
libvlc_event_send( p_md->p_event_manager, &event );
|
|
|
|
}
|
|
|
|
|
2007-08-24 23:54:27 +02:00
|
|
|
/**************************************************************************
|
|
|
|
* subitems
|
|
|
|
**************************************************************************/
|
|
|
|
libvlc_media_list_t *
|
2009-10-05 20:41:21 +02:00
|
|
|
libvlc_media_subitems( libvlc_media_t * p_md )
|
2007-08-24 23:54:27 +02:00
|
|
|
{
|
2007-08-25 03:26:35 +02:00
|
|
|
if( p_md->p_subitems )
|
|
|
|
libvlc_media_list_retain( p_md->p_subitems );
|
2007-08-24 23:54:27 +02:00
|
|
|
return p_md->p_subitems;
|
|
|
|
}
|
2007-08-25 18:28:13 +02:00
|
|
|
|
2009-11-20 12:17:13 +01:00
|
|
|
/**************************************************************************
|
2009-11-23 15:52:48 +01:00
|
|
|
* Getter for statistics information
|
2009-11-20 12:17:13 +01:00
|
|
|
**************************************************************************/
|
|
|
|
int libvlc_media_get_stats( libvlc_media_t *p_md,
|
|
|
|
libvlc_media_stats_t *p_stats )
|
|
|
|
{
|
|
|
|
if( !p_md->p_input_item )
|
|
|
|
return false;
|
|
|
|
|
|
|
|
input_stats_t *p_itm_stats = p_md->p_input_item->p_stats;
|
|
|
|
vlc_mutex_lock( &p_itm_stats->lock );
|
|
|
|
p_stats->i_read_bytes = p_itm_stats->i_read_bytes;
|
|
|
|
p_stats->f_input_bitrate = p_itm_stats->f_input_bitrate;
|
|
|
|
|
|
|
|
p_stats->i_demux_read_bytes = p_itm_stats->i_demux_read_bytes;
|
|
|
|
p_stats->f_demux_bitrate = p_itm_stats->f_demux_bitrate;
|
|
|
|
p_stats->i_demux_corrupted = p_itm_stats->i_demux_corrupted;
|
|
|
|
p_stats->i_demux_discontinuity = p_itm_stats->i_demux_discontinuity;
|
|
|
|
|
|
|
|
p_stats->i_decoded_video = p_itm_stats->i_decoded_video;
|
|
|
|
p_stats->i_decoded_audio = p_itm_stats->i_decoded_audio;
|
|
|
|
|
|
|
|
p_stats->i_displayed_pictures = p_itm_stats->i_displayed_pictures;
|
|
|
|
p_stats->i_lost_pictures = p_itm_stats->i_lost_pictures;
|
|
|
|
|
|
|
|
p_stats->i_played_abuffers = p_itm_stats->i_played_abuffers;
|
|
|
|
p_stats->i_lost_abuffers = p_itm_stats->i_lost_abuffers;
|
|
|
|
|
|
|
|
p_stats->i_sent_packets = p_itm_stats->i_sent_packets;
|
|
|
|
p_stats->i_sent_bytes = p_itm_stats->i_sent_bytes;
|
|
|
|
p_stats->f_send_bitrate = p_itm_stats->f_send_bitrate;
|
|
|
|
vlc_mutex_unlock( &p_itm_stats->lock );
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2007-08-25 18:28:13 +02:00
|
|
|
/**************************************************************************
|
|
|
|
* event_manager
|
|
|
|
**************************************************************************/
|
|
|
|
libvlc_event_manager_t *
|
2009-10-05 20:41:21 +02:00
|
|
|
libvlc_media_event_manager( libvlc_media_t * p_md )
|
2007-08-25 18:28:13 +02:00
|
|
|
{
|
2009-10-05 20:41:21 +02:00
|
|
|
assert( p_md );
|
2008-01-28 17:23:17 +01:00
|
|
|
|
2007-08-25 18:28:13 +02:00
|
|
|
return p_md->p_event_manager;
|
|
|
|
}
|
2007-10-20 19:56:00 +02:00
|
|
|
|
|
|
|
/**************************************************************************
|
2009-08-04 16:53:42 +02:00
|
|
|
* Get duration of media object (in ms)
|
2007-10-20 19:56:00 +02:00
|
|
|
**************************************************************************/
|
2008-05-31 21:06:17 +02:00
|
|
|
int64_t
|
2010-02-02 22:44:43 +01:00
|
|
|
libvlc_media_get_duration( libvlc_media_t * p_md )
|
2007-10-20 19:56:00 +02:00
|
|
|
{
|
2009-10-05 20:41:21 +02:00
|
|
|
assert( p_md );
|
2008-01-28 17:23:17 +01:00
|
|
|
|
2009-10-05 20:41:21 +02:00
|
|
|
if( !p_md->p_input_item )
|
2007-10-20 19:56:00 +02:00
|
|
|
{
|
2009-09-07 21:13:49 +02:00
|
|
|
libvlc_printerr( "No input item" );
|
2007-10-20 19:56:00 +02:00
|
|
|
return -1;
|
|
|
|
}
|
2008-08-03 19:40:30 +02:00
|
|
|
|
2010-01-16 15:41:43 +01:00
|
|
|
if (!input_item_IsPreparsed( p_md->p_input_item ))
|
|
|
|
return -1;
|
|
|
|
|
2010-01-16 16:11:08 +01:00
|
|
|
return from_mtime(input_item_GetDuration( p_md->p_input_item ));
|
2007-10-20 19:56:00 +02:00
|
|
|
}
|
|
|
|
|
2011-07-10 18:31:09 +02:00
|
|
|
static int media_parse(libvlc_media_t *media)
|
|
|
|
{
|
|
|
|
/* TODO: fetcher and parser independent of playlist */
|
2012-08-21 19:56:23 +02:00
|
|
|
#warning FIXME: remove pl_Get
|
|
|
|
playlist_t *playlist = pl_Get(media->p_libvlc_instance->p_libvlc_int);
|
2011-07-10 18:31:09 +02:00
|
|
|
|
|
|
|
/* TODO: Fetch art on need basis. But how not to break compatibility? */
|
|
|
|
playlist_AskForArtEnqueue(playlist, media->p_input_item );
|
|
|
|
return playlist_PreparseEnqueue(playlist, media->p_input_item);
|
|
|
|
}
|
|
|
|
|
2010-02-22 17:23:14 +01:00
|
|
|
/**************************************************************************
|
2011-07-10 18:31:09 +02:00
|
|
|
* Parse the media and wait.
|
2010-02-22 17:23:14 +01:00
|
|
|
**************************************************************************/
|
|
|
|
void
|
|
|
|
libvlc_media_parse(libvlc_media_t *media)
|
|
|
|
{
|
|
|
|
vlc_mutex_lock(&media->parsed_lock);
|
2011-07-10 18:31:09 +02:00
|
|
|
if (!media->has_asked_preparse)
|
|
|
|
{
|
|
|
|
media->has_asked_preparse = true;
|
|
|
|
vlc_mutex_unlock(&media->parsed_lock);
|
|
|
|
|
|
|
|
if (media_parse(media))
|
|
|
|
/* Parse failed: do not wait! */
|
|
|
|
return;
|
|
|
|
vlc_mutex_lock(&media->parsed_lock);
|
|
|
|
}
|
|
|
|
|
2010-02-22 17:23:14 +01:00
|
|
|
while (!media->is_parsed)
|
|
|
|
vlc_cond_wait(&media->parsed_cond, &media->parsed_lock);
|
|
|
|
vlc_mutex_unlock(&media->parsed_lock);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************************
|
2011-07-10 18:31:09 +02:00
|
|
|
* Parse the media but do not wait.
|
2010-02-22 17:23:14 +01:00
|
|
|
**************************************************************************/
|
|
|
|
void
|
|
|
|
libvlc_media_parse_async(libvlc_media_t *media)
|
|
|
|
{
|
2011-07-10 18:31:09 +02:00
|
|
|
bool needed;
|
|
|
|
|
|
|
|
vlc_mutex_lock(&media->parsed_lock);
|
2011-07-12 19:57:22 +02:00
|
|
|
needed = !media->has_asked_preparse;
|
2011-07-10 18:31:09 +02:00
|
|
|
media->has_asked_preparse = true;
|
|
|
|
vlc_mutex_unlock(&media->parsed_lock);
|
|
|
|
|
|
|
|
if (needed)
|
|
|
|
media_parse(media);
|
2010-02-22 17:23:14 +01:00
|
|
|
}
|
|
|
|
|
2007-10-20 19:56:00 +02:00
|
|
|
/**************************************************************************
|
2010-02-22 18:34:32 +01:00
|
|
|
* Get parsed status for media object.
|
2007-10-20 19:56:00 +02:00
|
|
|
**************************************************************************/
|
2008-03-17 20:20:33 +01:00
|
|
|
int
|
2011-07-10 18:31:09 +02:00
|
|
|
libvlc_media_is_parsed(libvlc_media_t *media)
|
2007-10-20 19:56:00 +02:00
|
|
|
{
|
2011-07-10 18:31:09 +02:00
|
|
|
bool parsed;
|
2008-08-03 19:40:30 +02:00
|
|
|
|
2011-07-10 18:31:09 +02:00
|
|
|
vlc_mutex_lock(&media->parsed_lock);
|
|
|
|
parsed = media->is_parsed;
|
|
|
|
vlc_mutex_unlock(&media->parsed_lock);
|
|
|
|
return parsed;
|
2007-10-20 19:56:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************************
|
2010-02-22 12:01:32 +01:00
|
|
|
* Sets media descriptor's user_data. user_data is specialized data
|
|
|
|
* accessed by the host application, VLC.framework uses it as a pointer to
|
2008-03-30 03:59:32 +02:00
|
|
|
* an native object that references a libvlc_media_t pointer
|
2007-10-20 19:56:00 +02:00
|
|
|
**************************************************************************/
|
2010-02-22 12:01:32 +01:00
|
|
|
void
|
2009-10-05 20:41:21 +02:00
|
|
|
libvlc_media_set_user_data( libvlc_media_t * p_md, void * p_new_user_data )
|
2007-10-20 19:56:00 +02:00
|
|
|
{
|
2009-10-05 20:41:21 +02:00
|
|
|
assert( p_md );
|
|
|
|
p_md->p_user_data = p_new_user_data;
|
2007-10-20 19:56:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************************
|
2010-02-22 12:01:32 +01:00
|
|
|
* Get media descriptor's user_data. user_data is specialized data
|
|
|
|
* accessed by the host application, VLC.framework uses it as a pointer to
|
2008-03-30 03:59:32 +02:00
|
|
|
* an native object that references a libvlc_media_t pointer
|
2007-10-20 19:56:00 +02:00
|
|
|
**************************************************************************/
|
|
|
|
void *
|
2009-10-05 20:41:21 +02:00
|
|
|
libvlc_media_get_user_data( libvlc_media_t * p_md )
|
2007-10-20 19:56:00 +02:00
|
|
|
{
|
2009-10-05 20:41:21 +02:00
|
|
|
assert( p_md );
|
|
|
|
return p_md->p_user_data;
|
2007-10-22 18:57:33 +02:00
|
|
|
}
|
2010-01-22 14:52:20 +01:00
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
* Get media descriptor's elementary streams description
|
|
|
|
**************************************************************************/
|
|
|
|
int
|
2010-02-22 17:51:35 +01:00
|
|
|
libvlc_media_get_tracks_info( libvlc_media_t *p_md, libvlc_media_track_info_t ** pp_es )
|
2010-01-22 14:52:20 +01:00
|
|
|
{
|
|
|
|
assert( p_md );
|
|
|
|
|
|
|
|
input_item_t *p_input_item = p_md->p_input_item;
|
|
|
|
vlc_mutex_lock( &p_input_item->lock );
|
|
|
|
|
|
|
|
const int i_es = p_input_item->i_es;
|
2010-02-22 17:51:35 +01:00
|
|
|
*pp_es = (i_es > 0) ? malloc( i_es * sizeof(libvlc_media_track_info_t) ) : NULL;
|
2010-01-22 14:52:20 +01:00
|
|
|
|
2010-10-31 12:35:44 +01:00
|
|
|
if( !*pp_es ) /* no ES, or OOM */
|
2010-01-22 14:52:20 +01:00
|
|
|
{
|
|
|
|
vlc_mutex_unlock( &p_input_item->lock );
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Fill array */
|
|
|
|
for( int i = 0; i < i_es; i++ )
|
|
|
|
{
|
2010-02-22 17:51:35 +01:00
|
|
|
libvlc_media_track_info_t *p_mes = *pp_es+i;
|
2010-01-22 14:52:20 +01:00
|
|
|
const es_format_t *p_es = p_input_item->es[i];
|
|
|
|
|
|
|
|
p_mes->i_codec = p_es->i_codec;
|
2010-01-27 10:42:29 +01:00
|
|
|
p_mes->i_id = p_es->i_id;
|
2010-01-22 14:52:20 +01:00
|
|
|
|
|
|
|
p_mes->i_profile = p_es->i_profile;
|
|
|
|
p_mes->i_level = p_es->i_level;
|
|
|
|
|
|
|
|
switch(p_es->i_cat)
|
|
|
|
{
|
|
|
|
case UNKNOWN_ES:
|
|
|
|
default:
|
2010-02-22 17:51:35 +01:00
|
|
|
p_mes->i_type = libvlc_track_unknown;
|
2010-01-22 14:52:20 +01:00
|
|
|
break;
|
|
|
|
case VIDEO_ES:
|
2010-02-22 17:51:35 +01:00
|
|
|
p_mes->i_type = libvlc_track_video;
|
2010-02-25 23:53:08 +01:00
|
|
|
p_mes->u.video.i_height = p_es->video.i_height;
|
|
|
|
p_mes->u.video.i_width = p_es->video.i_width;
|
2010-01-22 14:52:20 +01:00
|
|
|
break;
|
|
|
|
case AUDIO_ES:
|
2010-02-22 17:51:35 +01:00
|
|
|
p_mes->i_type = libvlc_track_audio;
|
2010-02-25 23:53:08 +01:00
|
|
|
p_mes->u.audio.i_channels = p_es->audio.i_channels;
|
|
|
|
p_mes->u.audio.i_rate = p_es->audio.i_rate;
|
2010-01-22 14:52:20 +01:00
|
|
|
break;
|
|
|
|
case SPU_ES:
|
2010-02-22 17:51:35 +01:00
|
|
|
p_mes->i_type = libvlc_track_text;
|
2010-01-22 14:52:20 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
vlc_mutex_unlock( &p_input_item->lock );
|
|
|
|
return i_es;
|
|
|
|
}
|
2013-02-12 21:45:25 +01:00
|
|
|
|
2013-02-12 21:52:48 +01:00
|
|
|
unsigned
|
2013-02-12 21:45:25 +01:00
|
|
|
libvlc_media_tracks_get( libvlc_media_t *p_md, libvlc_media_track_t *** pp_es )
|
|
|
|
{
|
|
|
|
assert( p_md );
|
|
|
|
|
|
|
|
input_item_t *p_input_item = p_md->p_input_item;
|
|
|
|
vlc_mutex_lock( &p_input_item->lock );
|
|
|
|
|
|
|
|
const int i_es = p_input_item->i_es;
|
|
|
|
*pp_es = (i_es > 0) ? calloc( i_es, sizeof(**pp_es) ) : NULL;
|
|
|
|
|
|
|
|
if( !*pp_es ) /* no ES, or OOM */
|
|
|
|
{
|
|
|
|
vlc_mutex_unlock( &p_input_item->lock );
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Fill array */
|
|
|
|
for( int i = 0; i < i_es; i++ )
|
|
|
|
{
|
|
|
|
libvlc_media_track_t *p_mes = calloc( 1, sizeof(*p_mes) );
|
|
|
|
if ( p_mes )
|
|
|
|
{
|
|
|
|
p_mes->audio = malloc( __MAX(__MAX(sizeof(*p_mes->audio),
|
|
|
|
sizeof(*p_mes->video)),
|
|
|
|
sizeof(*p_mes->subtitle)) );
|
|
|
|
}
|
|
|
|
if ( !p_mes || !p_mes->audio )
|
|
|
|
{
|
|
|
|
libvlc_media_tracks_release( *pp_es, i_es );
|
|
|
|
*pp_es = NULL;
|
2013-07-13 08:33:57 +02:00
|
|
|
free( p_mes );
|
2013-02-12 21:45:25 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
(*pp_es)[i] = p_mes;
|
|
|
|
|
|
|
|
const es_format_t *p_es = p_input_item->es[i];
|
|
|
|
|
|
|
|
p_mes->i_codec = p_es->i_codec;
|
|
|
|
p_mes->i_original_fourcc = p_es->i_original_fourcc;
|
|
|
|
p_mes->i_id = p_es->i_id;
|
|
|
|
|
|
|
|
p_mes->i_profile = p_es->i_profile;
|
|
|
|
p_mes->i_level = p_es->i_level;
|
|
|
|
|
|
|
|
p_mes->i_bitrate = p_es->i_bitrate;
|
|
|
|
p_mes->psz_language = p_es->psz_language != NULL ? strdup(p_es->psz_language) : NULL;
|
|
|
|
p_mes->psz_description = p_es->psz_description != NULL ? strdup(p_es->psz_description) : NULL;
|
|
|
|
|
|
|
|
switch(p_es->i_cat)
|
|
|
|
{
|
|
|
|
case UNKNOWN_ES:
|
|
|
|
default:
|
|
|
|
p_mes->i_type = libvlc_track_unknown;
|
|
|
|
break;
|
|
|
|
case VIDEO_ES:
|
|
|
|
p_mes->i_type = libvlc_track_video;
|
|
|
|
p_mes->video->i_height = p_es->video.i_height;
|
|
|
|
p_mes->video->i_width = p_es->video.i_width;
|
|
|
|
p_mes->video->i_sar_num = p_es->video.i_sar_num;
|
|
|
|
p_mes->video->i_sar_den = p_es->video.i_sar_den;
|
|
|
|
p_mes->video->i_frame_rate_num = p_es->video.i_frame_rate;
|
|
|
|
p_mes->video->i_frame_rate_den = p_es->video.i_frame_rate_base;
|
|
|
|
break;
|
|
|
|
case AUDIO_ES:
|
|
|
|
p_mes->i_type = libvlc_track_audio;
|
|
|
|
p_mes->audio->i_channels = p_es->audio.i_channels;
|
|
|
|
p_mes->audio->i_rate = p_es->audio.i_rate;
|
|
|
|
break;
|
|
|
|
case SPU_ES:
|
|
|
|
p_mes->i_type = libvlc_track_text;
|
|
|
|
p_mes->subtitle->psz_encoding = p_es->subs.psz_encoding != NULL ?
|
|
|
|
strdup(p_es->subs.psz_encoding) : NULL;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
vlc_mutex_unlock( &p_input_item->lock );
|
|
|
|
return i_es;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
* Release media descriptor's elementary streams description array
|
|
|
|
**************************************************************************/
|
2013-02-12 21:52:48 +01:00
|
|
|
void libvlc_media_tracks_release( libvlc_media_track_t **p_tracks, unsigned i_count )
|
2013-02-12 21:45:25 +01:00
|
|
|
{
|
2013-02-12 21:52:48 +01:00
|
|
|
for( unsigned i = 0; i < i_count; ++i )
|
2013-02-12 21:45:25 +01:00
|
|
|
{
|
|
|
|
if ( !p_tracks[i] )
|
|
|
|
continue;
|
|
|
|
free( p_tracks[i]->psz_language );
|
|
|
|
free( p_tracks[i]->psz_description );
|
|
|
|
switch( p_tracks[i]->i_type )
|
|
|
|
{
|
|
|
|
case libvlc_track_audio:
|
|
|
|
break;
|
|
|
|
case libvlc_track_video:
|
|
|
|
break;
|
|
|
|
case libvlc_track_text:
|
|
|
|
free( p_tracks[i]->subtitle->psz_encoding );
|
|
|
|
break;
|
|
|
|
case libvlc_track_unknown:
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
free( p_tracks[i]->audio );
|
|
|
|
free( p_tracks[i] );
|
|
|
|
}
|
|
|
|
free( p_tracks );
|
|
|
|
}
|