~ubuntu-branches/debian/jessie/k3b/jessie

« back to all changes in this revision

Viewing changes to plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp

  • Committer: Package Import Robot
  • Author(s): Pino Toscano, Lisandro Damián Nicanor Pérez Meyer, Pino Toscano
  • Date: 2013-08-25 18:42:53 UTC
  • Revision ID: package-import@ubuntu.com-20130825184253-3nlk9xxp8rjbcemj
Tags: 2.0.2-7
* Team upload.

[ Lisandro Damián Nicanor Pérez Meyer ]
* Enable the lame-based MP3 encoding plugin (based on Pino's work):
  - Build-Depend on libmp3lame-dev.
  - Install the new plugin (and its configuration) in libk3b6-extracodecs.

[ Pino Toscano ]
* Update Vcs-* headers.
* Bump Standards-Version to 3.9.4, no changes required.
* Add Fix-K3B-to-build-with-recent-FFMPEG-versions.patch (backported from
  upstream branch 2.0) and ffmpeg-more.diff to fix compatibility with newer
  ffmpeg/libav versions. (Closes: #720799)
* Add Prefer-growisofs-to-wodim-for-DVD-BluRay-burning.patch (backported from
  upstream branch 2.0) to prefer growisofs to wodim for DVD/BluRay; add the
  growisofs recommend. (Closes: #714944)
* Suggest kde-config-cddb for the CDDB configuration page. (Closes: #696828)

Show diffs side-by-side

added added

removed removed

Lines of Context:
88
88
    close();
89
89
 
90
90
    // open the file
 
91
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53,2,0)
 
92
    int err = ::avformat_open_input( &d->formatContext, m_filename.toLocal8Bit(), 0, 0 );
 
93
#else
91
94
    int err = ::av_open_input_file( &d->formatContext, m_filename.toLocal8Bit(), 0, 0, 0 );
 
95
#endif
92
96
    if( err < 0 ) {
93
97
        kDebug() << "(K3bFFMpegFile) unable to open " << m_filename << " with error " << err;
94
98
        return false;
95
99
    }
96
100
 
97
101
    // analyze the streams
 
102
#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53,3,0)
 
103
    ::avformat_find_stream_info( d->formatContext, 0 );
 
104
#else
98
105
    ::av_find_stream_info( d->formatContext );
 
106
#endif
99
107
 
100
108
    // we only handle files containing one audio stream
101
109
    if( d->formatContext->nb_streams != 1 ) {
129
137
 
130
138
    // open the codec on our context
131
139
    kDebug() << "(K3bFFMpegFile) found codec for " << m_filename;
132
 
    if( ::avcodec_open( codecContext, d->codec ) < 0 ) {
 
140
#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53,6,0)
 
141
    err = ::avcodec_open2( codecContext, d->codec, 0 );
 
142
#else
 
143
    err = ::avcodec_open( codecContext, d->codec );
 
144
#endif
 
145
    if( err < 0 ) {
133
146
        kDebug() << "(K3bFFMpegDecoderFactory) could not open codec.";
134
147
        return false;
135
148
    }
143
156
    }
144
157
 
145
158
    // dump some debugging info
 
159
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53,2,0)
 
160
    ::av_dump_format( d->formatContext, 0, m_filename.toLocal8Bit(), 0 );
 
161
#else
146
162
    ::dump_format( d->formatContext, 0, m_filename.toLocal8Bit(), 0 );
 
163
#endif
147
164
 
148
165
    return true;
149
166
}