Ticket #1043: mythdvd_v7.patch
File mythdvd_v7.patch, 5.1 KB (added by , 18 years ago) |
---|
-
libs/libmythtv/NuppelVideoPlayer.cpp
552 552 553 553 ClearAfterSeek(); 554 554 555 if (ringBuffer-> isDVD())555 if (ringBuffer->InDVDMenuOrStillFrame()) 556 556 ringBuffer->Seek(ringBuffer->DVD()->GetCellStartPos(), SEEK_SET); 557 557 558 558 if (textDisplayMode) … … 765 765 int NuppelVideoPlayer::OpenFile(bool skipDsp, uint retries, 766 766 bool allow_libmpeg2) 767 767 { 768 if (ringBuffer && ringBuffer->isDVD())769 allow_libmpeg2 = false;770 771 768 if (!skipDsp) 772 769 { 773 770 if (!ringBuffer) -
libs/libmythtv/avformatdecoder.cpp
274 274 allow_ac3_passthru(false), allow_dts_passthru(false), 275 275 disable_passthru(false), 276 276 // DVD 277 lastdvdtitle(0), dvdmenupktseen(false) 277 lastdvdtitle(0), dvdmenupktseen(false), 278 dvdvideopause(false) 278 279 { 279 280 bzero(¶ms, sizeof(AVFormatParameters)); 280 281 bzero(prvpkt, 3 * sizeof(char)); … … 1322 1323 } 1323 1324 } 1324 1325 1325 // Select a new track s at the next opportunity.1326 // Select a new track at the next opportunity 1326 1327 ResetTracks(); 1327 1328 1328 1329 // We have to do this here to avoid the NVP getting stuck … … 1738 1739 #define PICTURE_START 0x00000100 1739 1740 #define SLICE_MIN 0x00000101 1740 1741 #define SLICE_MAX 0x000001af 1742 #define SEQ_END_CODE 0x000001b7 1741 1743 1742 1744 void AvFormatDecoder::MpegPreProcessPkt(AVStream *stream, AVPacket *pkt) 1743 1745 { … … 1757 1759 unsigned int last_state = state; 1758 1760 state = ((state << 8) | v) & 0xFFFFFF; 1759 1761 1762 if (ringBuffer->isDVD() && pkt->size == 4 1763 && state == SEQ_END_CODE && !dvdvideopause) 1764 { 1765 dvdvideopause = true; 1766 d->ResetMPEG2(); 1767 return; 1768 } 1769 1760 1770 if (last_state != 0x000001) 1761 1771 continue; 1762 1772 else if (state >= SLICE_MIN && state <= SLICE_MAX) … … 2232 2242 2233 2243 bool allowedquit = false; 2234 2244 bool storevideoframes = false; 2235 bool dvdvideopause = false;2236 2245 2237 2246 avcodeclock.lock(); 2238 2247 AutoSelectTracks(); … … 2265 2274 VERBOSE(VB_PLAYBACK, 2266 2275 QString(LOC + "DVD Title Changed. Update framesPlayed: %1 ") 2267 2276 .arg(framesPlayed)); 2268 ScanStreams( false);2277 ScanStreams(true); 2269 2278 } 2270 2279 lastdvdtitle = dvdtitle; 2271 2280 … … 2291 2300 } 2292 2301 } 2293 2302 2294 if (ringBuffer->isDVD() && ringBuffer->DVD()->InStillFrame())2295 {2296 storevideoframes = false;2297 dvdvideopause = true;2298 }2299 2300 2303 if (!storevideoframes && storedPackets.count() > 0) 2301 2304 { 2302 2305 if (pkt) … … 2346 2349 if (pkt->dts != (int64_t)AV_NOPTS_VALUE) 2347 2350 pts = (long long)(av_q2d(curstream->time_base) * pkt->dts * 1000); 2348 2351 2349 if (ringBuffer->isDVD() && pkt->size == 4) 2352 if (ringBuffer->isDVD() && 2353 curstream->codec->codec_type == CODEC_TYPE_VIDEO) 2350 2354 { 2351 dvdvideopause = true; 2352 av_free_packet(pkt); 2353 continue; 2355 if (pkt->size == 4) 2356 MpegPreProcessPkt(curstream,pkt); 2357 else if (!d->HasMPEG2Dec()) 2358 { 2359 int current_width = curstream->codec->width; 2360 int video_width = GetNVP()->GetVideoWidth(); 2361 if (video_width > 0 && 2362 (video_width != current_width)) 2363 { 2364 av_free_packet(pkt); 2365 av_find_stream_info(ic); 2366 ScanStreams(false); 2367 allowedquit = true; 2368 continue; 2369 } 2370 } 2354 2371 } 2355 2372 2356 2373 if (storevideoframes && … … 2390 2407 } 2391 2408 } 2392 2409 2410 if (len == 4 && dvdvideopause) 2411 dvdvideopause = false; 2412 2393 2413 if (framesRead == 0 && !justAfterChange && 2394 2414 !(pkt->flags & PKT_FLAG_KEY)) 2395 2415 { … … 2594 2614 ret = avcodec_decode_video(context, &mpa_pic, 2595 2615 &gotpicture, ptr, len); 2596 2616 // Reparse it to not drop the DVD still frame 2597 if (dvdvideopause && storedPackets.count() == 0)2617 if (dvdvideopause) 2598 2618 ret = avcodec_decode_video(context, &mpa_pic, 2599 2619 &gotpicture, ptr, len); 2600 2620 } -
libs/libmythtv/avformatdecoder.h
237 237 // DVD 238 238 int lastdvdtitle; 239 239 bool dvdmenupktseen; 240 bool dvdvideopause; 240 241 }; 241 242 242 243 #endif